Skip to content

Commit

Permalink
chore(gomall/tutorial): ch10
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyutang committed May 27, 2024
1 parent af70409 commit 74d7504
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/cloudwego/biz-demo/gomall/app/frontend/biz/service"
"github.com/cloudwego/biz-demo/gomall/app/frontend/biz/utils"
category "github.com/cloudwego/biz-demo/gomall/app/frontend/hertz_gen/frontend/category"
common "github.com/cloudwego/biz-demo/gomall/app/frontend/hertz_gen/frontend/common"
"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/protocol/consts"
)
Expand Down
1 change: 1 addition & 0 deletions gomall/tutorial/ch10/app/product/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ require (
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 2 additions & 0 deletions gomall/tutorial/ch10/app/product/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY=
gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
5 changes: 4 additions & 1 deletion gomall/tutorial/ch10/app/product/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
kitexlogrus "github.com/kitex-contrib/obs-opentelemetry/logging/logrus"
consul "github.com/kitex-contrib/registry-consul"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
)

func main() {
Expand All @@ -52,7 +53,9 @@ func kitexInit() (opts []server.Option) {
opts = append(opts, server.WithServiceAddr(addr))

r, err := consul.NewConsulRegister(conf.GetConf().Registry.RegistryAddress[0])

if err != nil {
klog.Fatal(err)
}
// service info
opts = append(opts, server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{
ServiceName: conf.GetConf().Kitex.Service,
Expand Down

0 comments on commit 74d7504

Please sign in to comment.