Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zGo
Commits
c314bf18
Commit
c314bf18
authored
Oct 31, 2025
by
Vladimir Barsukov
Browse files
fix
parent
156d4a2a
Changes
16
Show whitespace changes
Inline
Side-by-side
zcache/zcache.go
View file @
c314bf18
package
zcache
package
zcache
import
(
import
(
"github.com/patrickmn/go-cache"
"time"
"time"
"github.com/patrickmn/go-cache"
)
)
func
New
(
defaultExpiration
,
cleanupInterval
time
.
Duration
)
*
cache
.
Cache
{
func
New
(
defaultExpiration
,
cleanupInterval
time
.
Duration
)
*
cache
.
Cache
{
...
...
zcron/zcron.go
View file @
c314bf18
package
zcron
package
zcron
import
(
import
(
"github.com/go-co-op/gocron"
"time"
"time"
"github.com/go-co-op/gocron"
)
)
func
New
(
loc
*
time
.
Location
)
*
gocron
.
Scheduler
{
func
New
(
loc
*
time
.
Location
)
*
gocron
.
Scheduler
{
...
@@ -11,7 +12,6 @@ func New(loc *time.Location) *gocron.Scheduler {
...
@@ -11,7 +12,6 @@ func New(loc *time.Location) *gocron.Scheduler {
func
Default
()
*
gocron
.
Scheduler
{
func
Default
()
*
gocron
.
Scheduler
{
s
:=
gocron
.
NewScheduler
(
time
.
UTC
)
s
:=
gocron
.
NewScheduler
(
time
.
UTC
)
s
.
SingletonModeAll
()
return
s
return
s
}
}
zdb/any.go
View file @
c314bf18
...
@@ -2,10 +2,11 @@ package zdb
...
@@ -2,10 +2,11 @@ package zdb
import
(
import
(
"fmt"
"fmt"
"reflect"
"github.com/google/uuid"
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
"github.com/jackc/pgx/v5/pgtype"
"reflect"
)
)
func
(
d
*
Pool
)
WAny
(
dst
any
,
sql
string
,
args
...
any
)
error
{
func
(
d
*
Pool
)
WAny
(
dst
any
,
sql
string
,
args
...
any
)
error
{
...
...
zdb/conn.go
View file @
c314bf18
...
@@ -2,6 +2,7 @@ package zdb
...
@@ -2,6 +2,7 @@ package zdb
import
(
import
(
"fmt"
"fmt"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/jackc/pgx/v5/pgxpool"
)
)
...
...
zdb/misc.go
View file @
c314bf18
...
@@ -2,8 +2,9 @@ package zdb
...
@@ -2,8 +2,9 @@ package zdb
import
(
import
(
"errors"
"errors"
"github.com/jackc/pgx/v5"
"strings"
"strings"
"github.com/jackc/pgx/v5"
)
)
var
ErrNoRows
=
pgx
.
ErrNoRows
var
ErrNoRows
=
pgx
.
ErrNoRows
...
...
zdb/pool.go
View file @
c314bf18
...
@@ -3,13 +3,14 @@ package zdb
...
@@ -3,13 +3,14 @@ package zdb
import
(
import
(
"context"
"context"
"fmt"
"fmt"
"github.com/jackc/pgx/v5/pgxpool"
"reflect"
"reflect"
"runtime"
"runtime"
"strings"
"strings"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
"time"
"time"
"github.com/jackc/pgx/v5/pgxpool"
)
)
type
Pool
struct
{
type
Pool
struct
{
...
...
zdebug/zdebug.go
View file @
c314bf18
...
@@ -2,11 +2,12 @@ package zdebug
...
@@ -2,11 +2,12 @@ package zdebug
import
(
import
(
"fmt"
"fmt"
"git.barsukov.pro/barsukov/zgo/zutils"
"log"
"log"
"runtime"
"runtime"
"strings"
"strings"
"time"
"time"
"git.barsukov.pro/barsukov/zgo/zutils"
)
)
func
NewMonitor
(
secs
int
)
{
func
NewMonitor
(
secs
int
)
{
...
...
zguid/zguid.go
View file @
c314bf18
...
@@ -3,6 +3,7 @@ package zguid
...
@@ -3,6 +3,7 @@ package zguid
import
(
import
(
"crypto/md5"
"crypto/md5"
"fmt"
"fmt"
"github.com/google/uuid"
"github.com/google/uuid"
)
)
...
...
zjson/go_json.go
View file @
c314bf18
...
@@ -3,8 +3,9 @@
...
@@ -3,8 +3,9 @@
package
zjson
package
zjson
import
(
import
(
"github.com/goccy/go-json"
"unsafe"
"unsafe"
"github.com/goccy/go-json"
)
)
func
ToBytes
(
obj
any
)
([]
byte
,
error
)
{
func
ToBytes
(
obj
any
)
([]
byte
,
error
)
{
...
...
zmigrations/dev.go
View file @
c314bf18
...
@@ -4,6 +4,7 @@ package zmigrations
...
@@ -4,6 +4,7 @@ package zmigrations
import
(
import
(
"fmt"
"fmt"
"git.barsukov.pro/barsukov/zgo/zdb"
"git.barsukov.pro/barsukov/zgo/zdb"
)
)
...
...
zmigrations/zmigration.go
View file @
c314bf18
...
@@ -3,9 +3,10 @@ package zmigrations
...
@@ -3,9 +3,10 @@ package zmigrations
import
(
import
(
"embed"
"embed"
"fmt"
"fmt"
"git.barsukov.pro/barsukov/zgo/zdb"
"io/fs"
"io/fs"
"log"
"log"
"git.barsukov.pro/barsukov/zgo/zdb"
)
)
func
Migrations
(
db
*
zdb
.
Pool
,
files
embed
.
FS
,
loc
string
,
reCreateSchema
...
string
)
error
{
func
Migrations
(
db
*
zdb
.
Pool
,
files
embed
.
FS
,
loc
string
,
reCreateSchema
...
string
)
error
{
...
...
zq/zq.go
View file @
c314bf18
...
@@ -2,9 +2,10 @@ package zq
...
@@ -2,9 +2,10 @@ package zq
import
(
import
(
"fmt"
"fmt"
"runtime"
"git.barsukov.pro/barsukov/zgo/zatomic"
"git.barsukov.pro/barsukov/zgo/zatomic"
"git.barsukov.pro/barsukov/zgo/zquit"
"git.barsukov.pro/barsukov/zgo/zquit"
"runtime"
)
)
type
ZQ
struct
{
type
ZQ
struct
{
...
...
zquit/zquit.go
View file @
c314bf18
...
@@ -2,14 +2,15 @@ package zquit
...
@@ -2,14 +2,15 @@ package zquit
import
(
import
(
"fmt"
"fmt"
"git.barsukov.pro/barsukov/zgo/zwg"
"github.com/gin-gonic/gin"
"log"
"log"
"net/http"
"net/http"
"os"
"os"
"os/signal"
"os/signal"
"syscall"
"syscall"
"time"
"time"
"git.barsukov.pro/barsukov/zgo/zwg"
"github.com/gin-gonic/gin"
)
)
type
ZQuit
struct
{
type
ZQuit
struct
{
...
...
zs3/zs3.go
View file @
c314bf18
...
@@ -3,11 +3,12 @@ package zs3
...
@@ -3,11 +3,12 @@ package zs3
import
(
import
(
"bytes"
"bytes"
"fmt"
"fmt"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3"
"io"
)
)
type
ZS3
struct
{
type
ZS3
struct
{
...
...
zsem/zsem.go
View file @
c314bf18
...
@@ -2,8 +2,9 @@ package zsem
...
@@ -2,8 +2,9 @@ package zsem
import
(
import
(
"context"
"context"
"golang.org/x/sync/semaphore"
"runtime"
"runtime"
"golang.org/x/sync/semaphore"
)
)
type
ZSem
struct
{
type
ZSem
struct
{
...
...
zutils/array.go
View file @
c314bf18
package
zutils
package
zutils
import
(
import
(
"golang.org/x/exp/constraints"
"reflect"
"reflect"
"sort"
"sort"
"golang.org/x/exp/constraints"
)
)
func
ArrayUnique
[
T
comparable
](
s
[]
T
)
[]
T
{
func
ArrayUnique
[
T
comparable
](
s
[]
T
)
[]
T
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment