Skip to content

Commit

Permalink
chore: update go-zero to v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Feb 1, 2022
1 parent b1f704d commit 23191b4
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 78 deletions.
22 changes: 12 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ require (
github.com/json-iterator/go v1.1.11
github.com/olivere/elastic/v7 v7.0.28
github.com/stretchr/testify v1.7.0
github.com/tal-tech/go-zero v1.2.5
github.com/vjeantet/jodaTime v1.0.0
github.com/zeromicro/go-queue v1.1.1
github.com/zeromicro/go-queue v1.1.2
github.com/zeromicro/go-zero v1.3.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/frankban/quicktest v1.13.1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -25,7 +27,7 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/openzipkin/zipkin-go v0.3.0 // indirect
github.com/openzipkin/zipkin-go v0.4.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -38,14 +40,14 @@ require (
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/xdg/scram v1.0.3 // indirect
github.com/xdg/stringprep v1.0.3 // indirect
go.opentelemetry.io/otel v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.1.0 // indirect
go.opentelemetry.io/otel/sdk v1.1.0 // indirect
go.opentelemetry.io/otel/trace v1.1.0 // indirect
go.opentelemetry.io/otel v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.3.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/trace v1.3.0 // indirect
go.uber.org/automaxprocs v1.4.0 // indirect
golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68 // indirect
google.golang.org/grpc v1.42.0 // indirect
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect
google.golang.org/grpc v1.43.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
89 changes: 43 additions & 46 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Offset: first
## Acknowledgements
go-stash is powered by [**go-zero**](https://github.com/zeromicro/go-zero) ![GitHub Repo stars](https://img.shields.io/github/stars/tal-tech/go-zero?style=social) ![GitHub forks](https://img.shields.io/github/forks/tal-tech/go-zero?style=social) for great performance!
go-stash is powered by [**go-zero**](https://github.com/zeromicro/go-zero) ![GitHub Repo stars](https://img.shields.io/github/stars/zeromicro/go-zero?style=social) ![GitHub forks](https://img.shields.io/github/forks/zeromicro/go-zero?style=social) for great performance!
## Give a Star! ⭐
Expand Down
2 changes: 1 addition & 1 deletion stash/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"time"

"github.com/tal-tech/go-zero/core/service"
"github.com/zeromicro/go-zero/core/service"
)

type (
Expand Down
28 changes: 14 additions & 14 deletions stash/es/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"time"

"github.com/olivere/elastic/v7"
"github.com/tal-tech/go-zero/core/fx"
"github.com/tal-tech/go-zero/core/lang"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/syncx"
"github.com/vjeantet/jodaTime"
"github.com/zeromicro/go-zero/core/fx"
"github.com/zeromicro/go-zero/core/lang"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/syncx"
)

const (
Expand All @@ -35,20 +35,20 @@ type (
IndexFunc func() string

Index struct {
client *elastic.Client
indexFormat IndexFormat
indices map[string]lang.PlaceholderType
lock sync.RWMutex
sharedCalls syncx.SharedCalls
client *elastic.Client
indexFormat IndexFormat
indices map[string]lang.PlaceholderType
lock sync.RWMutex
singleFlight syncx.SingleFlight
}
)

func NewIndex(client *elastic.Client, indexFormat string, loc *time.Location) *Index {
return &Index{
client: client,
indexFormat: buildIndexFormatter(indexFormat, loc),
indices: make(map[string]lang.PlaceholderType),
sharedCalls: syncx.NewSharedCalls(),
client: client,
indexFormat: buildIndexFormatter(indexFormat, loc),
indices: make(map[string]lang.PlaceholderType),
singleFlight: syncx.NewSingleFlight(),
}
}

Expand All @@ -68,7 +68,7 @@ func (idx *Index) GetIndex(m map[string]interface{}) string {
}

func (idx *Index) ensureIndex(index string) error {
_, err := idx.sharedCalls.Do(index, func() (i interface{}, err error) {
_, err := idx.singleFlight.Do(index, func() (i interface{}, err error) {
idx.lock.Lock()
defer idx.lock.Unlock()

Expand Down
4 changes: 2 additions & 2 deletions stash/es/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/kevwan/go-stash/stash/config"
"github.com/olivere/elastic/v7"
"github.com/tal-tech/go-zero/core/executors"
"github.com/tal-tech/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/executors"
"github.com/zeromicro/go-zero/core/logx"
)

type (
Expand Down
8 changes: 4 additions & 4 deletions stash/stash.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"github.com/kevwan/go-stash/stash/filter"
"github.com/kevwan/go-stash/stash/handler"
"github.com/olivere/elastic/v7"
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/proc"
"github.com/tal-tech/go-zero/core/service"
"github.com/zeromicro/go-queue/kq"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/proc"
"github.com/zeromicro/go-zero/core/service"
)

var configFile = flag.String("f", "etc/config.yaml", "Specify the config file")
Expand Down

0 comments on commit 23191b4

Please sign in to comment.