Skip to content

Commit

Permalink
Merge pull request #152 from nabbar/fix_2023-02-28
Browse files Browse the repository at this point in the history
Fix 2023-02

## Package Status:
  - Fix text formatting

## Package HTTPServer:
  - fix TLS check, config & loading for server

## Bump dependancies
  - dependencies based on go 1.20
  - change nutsdb owner repos
  • Loading branch information
nabbar authored Feb 28, 2023
2 parents 443935a + 854c2fa commit 7a5650a
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 48 deletions.
49 changes: 24 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/nabbar/golib

go 1.19
go 1.20

require (
github.com/aws/aws-sdk-go-v2 v1.17.5
github.com/aws/aws-sdk-go-v2/config v1.18.14
github.com/aws/aws-sdk-go-v2/credentials v1.13.14
github.com/aws/aws-sdk-go-v2/service/iam v1.19.3
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.4
github.com/aws/aws-sdk-go-v2/config v1.18.15
github.com/aws/aws-sdk-go-v2/credentials v1.13.15
github.com/aws/aws-sdk-go-v2/service/iam v1.19.4
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.5
github.com/bits-and-blooms/bitset v1.5.0
github.com/c-bata/go-prompt v0.2.6
github.com/fatih/color v1.14.1
Expand All @@ -29,9 +29,10 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/nats-io/jwt/v2 v2.3.0
github.com/nats-io/nats-server/v2 v2.9.14
github.com/nats-io/nats.go v1.23.0
github.com/onsi/ginkgo/v2 v2.8.3
github.com/onsi/gomega v1.27.1
github.com/nats-io/nats.go v1.24.0
github.com/nutsdb/nutsdb v0.12.0
github.com/onsi/ginkgo/v2 v2.8.4
github.com/onsi/gomega v1.27.2
github.com/pelletier/go-toml v1.9.5
github.com/prometheus/client_golang v1.14.0
github.com/shirou/gopsutil v3.21.11+incompatible
Expand All @@ -42,9 +43,8 @@ require (
github.com/vbauerster/mpb/v5 v5.4.0
github.com/xanzy/go-gitlab v0.80.2
github.com/xhit/go-simple-mail v2.2.2+incompatible
github.com/xujiajun/nutsdb v0.11.1
github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
golang.org/x/net v0.7.0
golang.org/x/oauth2 v0.5.0
golang.org/x/sync v0.1.0
Expand All @@ -61,9 +61,8 @@ require (

require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/ClickHouse/ch-go v0.52.1 // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.6.2 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/ClickHouse/ch-go v0.53.0 // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.6.5 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
Expand All @@ -84,13 +83,13 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.24 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bwmarrin/snowflake v0.3.0 // indirect
github.com/bytedance/sonic v1.8.1 // indirect
github.com/bytedance/sonic v1.8.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
Expand All @@ -117,7 +116,7 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -134,17 +133,17 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.3.0 // indirect
github.com/jackc/pgx/v5 v5.3.1 // indirect
github.com/jaytaylor/html2text v0.0.0-20211105163654-bc68cce691ba // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/ratelimit v1.0.2 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/leodido/go-urn v1.2.2 // indirect
github.com/lni/goutils v1.3.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
Expand All @@ -153,7 +152,7 @@ require (
github.com/mattn/go-tty v0.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/microsoft/go-mssqldb v0.20.0 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/dns v1.1.51 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
Expand All @@ -176,7 +175,7 @@ require (
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/afero v1.9.4 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
Expand All @@ -190,8 +189,8 @@ require (
github.com/x448/float16 v0.8.4 // indirect
github.com/xujiajun/mmap-go v1.0.1 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opentelemetry.io/otel v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
golang.org/x/arch v0.2.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.8.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions httpserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ func (c *Config) GetTLS() (libtls.TLSConfig, liberr.Error) {
}

func (c *Config) CheckTLS() (libtls.TLSConfig, liberr.Error) {
if ssl, err := c.GetTLS(); err == nil {
if ssl, err := c.GetTLS(); err != nil {
return nil, err
} else if ssl != nil && ssl.LenCertificatePair() > 0 {
} else if ssl == nil || ssl.LenCertificatePair() < 1 {
return nil, ErrorServerValidate.ErrorParent(fmt.Errorf("not certificates defined"))
} else {
return ssl, nil
Expand Down
6 changes: 5 additions & 1 deletion httpserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import (

func (o *srv) Start(ctx context.Context) error {
ssl := o.cfgGetTLS()
if ssl == nil && o.IsTLS() {

if o.IsTLS() && ssl == nil {
return ErrorServerValidate.ErrorParent(fmt.Errorf("TLS Config is not well defined"))
}

Expand All @@ -62,6 +63,9 @@ func (o *srv) Start(ctx context.Context) error {
}

if e := o.cfgGetServer().initServer(s); e != nil {
ent := o.logger().Entry(liblog.ErrorLevel, "init http2 server")
ent.ErrorAdd(true, e)
ent.Log()
return e
}

Expand Down
4 changes: 2 additions & 2 deletions nutsdb/Command.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
package nutsdb

import (
"github.com/xujiajun/nutsdb"
"github.com/xujiajun/nutsdb/ds/zset"
"github.com/nutsdb/nutsdb"
"github.com/nutsdb/nutsdb/ds/zset"
)

type Commands interface {
Expand Down
4 changes: 2 additions & 2 deletions nutsdb/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import (
"github.com/lni/dragonboat/v3/statemachine"
libclu "github.com/nabbar/golib/cluster"
liberr "github.com/nabbar/golib/errors"
"github.com/xujiajun/nutsdb"
"github.com/xujiajun/nutsdb/ds/zset"
"github.com/nutsdb/nutsdb"
"github.com/nutsdb/nutsdb/ds/zset"
)

type Client interface {
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
libval "github.com/go-playground/validator/v10"
libclu "github.com/nabbar/golib/cluster"
liberr "github.com/nabbar/golib/errors"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/configDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

libval "github.com/go-playground/validator/v10"
liberr "github.com/nabbar/golib/errors"
nutsdb "github.com/xujiajun/nutsdb"
nutsdb "github.com/nutsdb/nutsdb"
)

type NutsDBOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/entryKv.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/fxamacker/cbor/v2"
liberr "github.com/nabbar/golib/errors"
liblog "github.com/nabbar/golib/logger"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (

dgbstm "github.com/lni/dragonboat/v3/statemachine"
liberr "github.com/nabbar/golib/errors"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"time"

liberr "github.com/nabbar/golib/errors"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
"github.com/xujiajun/utils/filesystem"
)

Expand Down
4 changes: 2 additions & 2 deletions nutsdb/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
"io"

libsh "github.com/nabbar/golib/shell"
"github.com/xujiajun/nutsdb"
"github.com/xujiajun/nutsdb/ds/zset"
"github.com/nutsdb/nutsdb"
"github.com/nutsdb/nutsdb/ds/zset"
)

type shellCommand struct {
Expand Down
2 changes: 1 addition & 1 deletion nutsdb/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/nabbar/golib/archive"
liberr "github.com/nabbar/golib/errors"
"github.com/nabbar/golib/ioutils"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
)

type Snapshot interface {
Expand Down
8 changes: 1 addition & 7 deletions status/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ func (e *encodeModel) GinRender(c *ginsdk.Context, isText bool, isShort bool) {
}
}

func (e *encodeModel) cleanString(str string) string {
str = strings.Replace(str, "\n", " ", -1)
str = strings.Replace(str, "\r", "", -1)
return str
}

func (e *encodeModel) stringName() string {
var inf []string

Expand Down Expand Up @@ -146,7 +140,7 @@ func (e *encodeModel) String() string {
buf.Write(p)
}

return e.cleanString(buf.String())
return buf.String()
}

func (e *encodeModel) Bytes() []byte {
Expand Down
2 changes: 1 addition & 1 deletion test/test-nutsdb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
libsh "github.com/nabbar/golib/shell"
libvrs "github.com/nabbar/golib/version"
"github.com/vbauerster/mpb/v5"
"github.com/xujiajun/nutsdb"
"github.com/nutsdb/nutsdb"
)

const (
Expand Down

0 comments on commit 7a5650a

Please sign in to comment.