auth service
This commit is contained in:
parent
76d3d6f20a
commit
bda2501bae
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
app/auth/.env
|
8
Makefile
8
Makefile
@ -3,4 +3,10 @@ export ROOT_MOD=github.com/suyiiyii/hertz101
|
||||
.PHONY: gen-user
|
||||
gen-user:
|
||||
@cd app/user && cwgo server --type RPC --service user --module ${ROOT_MOD}/app/user --pass "-use ${ROOT_MOD}/rpc_gen/kitex_gen" -I ../../idl --idl ../../idl/user.proto
|
||||
@cd rpc_gen && cwgo client --type RPC --service user --module ${ROOT_MOD}/rpc_gen --I ../idl --idl ../idl/user.proto
|
||||
@cd rpc_gen && cwgo client --type RPC --service user --module ${ROOT_MOD}/rpc_gen --I ../idl --idl ../idl/user.proto
|
||||
|
||||
|
||||
.PHONY: gen-auth
|
||||
gen-auth:
|
||||
@cd app/auth && cwgo server --type RPC --service auth --module ${ROOT_MOD}/app/auth --pass "-use ${ROOT_MOD}/rpc_gen/kitex_gen" -I ../../idl --idl ../../idl/auth.proto
|
||||
@cd rpc_gen && cwgo client --type RPC --service auth --module ${ROOT_MOD}/rpc_gen --I ../idl --idl ../idl/auth.proto
|
35
app/auth/.gitignore
vendored
Normal file
35
app/auth/.gitignore
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
_obj
|
||||
_test
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
_testmain.go
|
||||
*.exe
|
||||
*.exe~
|
||||
*.test
|
||||
*.prof
|
||||
*.rar
|
||||
*.zip
|
||||
*.gz
|
||||
*.psd
|
||||
*.bmd
|
||||
*.cfg
|
||||
*.pptx
|
||||
*.log
|
||||
*nohup.out
|
||||
*settings.pyc
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
!.gitkeep
|
||||
.DS_Store
|
||||
/.idea
|
||||
/.vscode
|
||||
/output
|
||||
*.local.yml
|
10
app/auth/biz/dal/init.go
Normal file
10
app/auth/biz/dal/init.go
Normal file
@ -0,0 +1,10 @@
|
||||
package dal
|
||||
|
||||
import (
|
||||
"github.com/suyiiyii/hertz101/app/auth/biz/dal/mysql"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
//redis.Init()
|
||||
mysql.Init()
|
||||
}
|
33
app/auth/biz/dal/mysql/init.go
Normal file
33
app/auth/biz/dal/mysql/init.go
Normal file
@ -0,0 +1,33 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/suyiiyii/hertz101/app/auth/conf"
|
||||
"os"
|
||||
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
DB *gorm.DB
|
||||
err error
|
||||
)
|
||||
|
||||
func Init() {
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
dsn := fmt.Sprintf(conf.GetConf().MySQL.DSN, os.Getenv("MYSQL_USER"), os.Getenv("MYSQL_PASSWORD"), os.Getenv("MYSQL_HOST"), os.Getenv("MYSQL_PORT"))
|
||||
DB, err = gorm.Open(mysql.Open(dsn),
|
||||
&gorm.Config{
|
||||
PrepareStmt: true,
|
||||
SkipDefaultTransaction: true,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
24
app/auth/biz/dal/redis/init.go
Normal file
24
app/auth/biz/dal/redis/init.go
Normal file
@ -0,0 +1,24 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/suyiiyii/hertz101/app/auth/conf"
|
||||
)
|
||||
|
||||
var (
|
||||
RedisClient *redis.Client
|
||||
)
|
||||
|
||||
func Init() {
|
||||
RedisClient = redis.NewClient(&redis.Options{
|
||||
Addr: conf.GetConf().Redis.Address,
|
||||
Username: conf.GetConf().Redis.Username,
|
||||
Password: conf.GetConf().Redis.Password,
|
||||
DB: conf.GetConf().Redis.DB,
|
||||
})
|
||||
if err := RedisClient.Ping(context.Background()).Err(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
20
app/auth/biz/service/deliver_token_by_rpc.go
Normal file
20
app/auth/biz/service/deliver_token_by_rpc.go
Normal file
@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
type DeliverTokenByRPCService struct {
|
||||
ctx context.Context
|
||||
} // NewDeliverTokenByRPCService new DeliverTokenByRPCService
|
||||
func NewDeliverTokenByRPCService(ctx context.Context) *DeliverTokenByRPCService {
|
||||
return &DeliverTokenByRPCService{ctx: ctx}
|
||||
}
|
||||
|
||||
// Run create note info
|
||||
func (s *DeliverTokenByRPCService) Run(req *auth.DeliverTokenReq) (resp *auth.DeliveryResp, err error) {
|
||||
// Finish your business logic.
|
||||
|
||||
return
|
||||
}
|
21
app/auth/biz/service/deliver_token_by_rpc_test.go
Normal file
21
app/auth/biz/service/deliver_token_by_rpc_test.go
Normal file
@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
func TestDeliverTokenByRPC_Run(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := NewDeliverTokenByRPCService(ctx)
|
||||
// init req and assert value
|
||||
|
||||
req := &auth.DeliverTokenReq{}
|
||||
resp, err := s.Run(req)
|
||||
t.Logf("err: %v", err)
|
||||
t.Logf("resp: %v", resp)
|
||||
|
||||
// todo: edit your unit test
|
||||
|
||||
}
|
20
app/auth/biz/service/verify_token_by_rpc.go
Normal file
20
app/auth/biz/service/verify_token_by_rpc.go
Normal file
@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
type VerifyTokenByRPCService struct {
|
||||
ctx context.Context
|
||||
} // NewVerifyTokenByRPCService new VerifyTokenByRPCService
|
||||
func NewVerifyTokenByRPCService(ctx context.Context) *VerifyTokenByRPCService {
|
||||
return &VerifyTokenByRPCService{ctx: ctx}
|
||||
}
|
||||
|
||||
// Run create note info
|
||||
func (s *VerifyTokenByRPCService) Run(req *auth.VerifyTokenReq) (resp *auth.VerifyResp, err error) {
|
||||
// Finish your business logic.
|
||||
|
||||
return
|
||||
}
|
21
app/auth/biz/service/verify_token_by_rpc_test.go
Normal file
21
app/auth/biz/service/verify_token_by_rpc_test.go
Normal file
@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
func TestVerifyTokenByRPC_Run(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := NewVerifyTokenByRPCService(ctx)
|
||||
// init req and assert value
|
||||
|
||||
req := &auth.VerifyTokenReq{}
|
||||
resp, err := s.Run(req)
|
||||
t.Logf("err: %v", err)
|
||||
t.Logf("resp: %v", resp)
|
||||
|
||||
// todo: edit your unit test
|
||||
|
||||
}
|
7
app/auth/build.sh
Normal file
7
app/auth/build.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
RUN_NAME="auth"
|
||||
mkdir -p output/bin output/conf
|
||||
cp script/* output/
|
||||
cp -r conf/* output/conf
|
||||
chmod +x output/bootstrap.sh
|
||||
go build -o output/bin/${RUN_NAME}
|
110
app/auth/conf/conf.go
Normal file
110
app/auth/conf/conf.go
Normal file
@ -0,0 +1,110 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/cloudwego/kitex/pkg/klog"
|
||||
"github.com/kr/pretty"
|
||||
"gopkg.in/validator.v2"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
var (
|
||||
conf *Config
|
||||
once sync.Once
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Env string
|
||||
Kitex Kitex `yaml:"kitex"`
|
||||
MySQL MySQL `yaml:"mysql"`
|
||||
Redis Redis `yaml:"redis"`
|
||||
Registry Registry `yaml:"registry"`
|
||||
}
|
||||
|
||||
type MySQL struct {
|
||||
DSN string `yaml:"dsn"`
|
||||
}
|
||||
|
||||
type Redis struct {
|
||||
Address string `yaml:"address"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
DB int `yaml:"db"`
|
||||
}
|
||||
|
||||
type Kitex struct {
|
||||
Service string `yaml:"service"`
|
||||
Address string `yaml:"address"`
|
||||
LogLevel string `yaml:"log_level"`
|
||||
LogFileName string `yaml:"log_file_name"`
|
||||
LogMaxSize int `yaml:"log_max_size"`
|
||||
LogMaxBackups int `yaml:"log_max_backups"`
|
||||
LogMaxAge int `yaml:"log_max_age"`
|
||||
}
|
||||
|
||||
type Registry struct {
|
||||
RegistryAddress []string `yaml:"registry_address"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
|
||||
// GetConf gets configuration instance
|
||||
func GetConf() *Config {
|
||||
once.Do(initConf)
|
||||
return conf
|
||||
}
|
||||
|
||||
func initConf() {
|
||||
prefix := "conf"
|
||||
confFileRelPath := filepath.Join(prefix, filepath.Join(GetEnv(), "conf.yaml"))
|
||||
content, err := ioutil.ReadFile(confFileRelPath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
conf = new(Config)
|
||||
err = yaml.Unmarshal(content, conf)
|
||||
if err != nil {
|
||||
klog.Error("parse yaml error - %v", err)
|
||||
panic(err)
|
||||
}
|
||||
if err := validator.Validate(conf); err != nil {
|
||||
klog.Error("validate config error - %v", err)
|
||||
panic(err)
|
||||
}
|
||||
conf.Env = GetEnv()
|
||||
pretty.Printf("%+v\n", conf)
|
||||
}
|
||||
|
||||
func GetEnv() string {
|
||||
e := os.Getenv("GO_ENV")
|
||||
if len(e) == 0 {
|
||||
return "test"
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
func LogLevel() klog.Level {
|
||||
level := GetConf().Kitex.LogLevel
|
||||
switch level {
|
||||
case "trace":
|
||||
return klog.LevelTrace
|
||||
case "debug":
|
||||
return klog.LevelDebug
|
||||
case "info":
|
||||
return klog.LevelInfo
|
||||
case "notice":
|
||||
return klog.LevelNotice
|
||||
case "warn":
|
||||
return klog.LevelWarn
|
||||
case "error":
|
||||
return klog.LevelError
|
||||
case "fatal":
|
||||
return klog.LevelFatal
|
||||
default:
|
||||
return klog.LevelInfo
|
||||
}
|
||||
}
|
23
app/auth/conf/dev/conf.yaml
Normal file
23
app/auth/conf/dev/conf.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
kitex:
|
||||
service: "auth"
|
||||
address: ":8888"
|
||||
log_level: info
|
||||
log_file_name: "log/kitex.log"
|
||||
log_max_size: 10
|
||||
log_max_age: 3
|
||||
log_max_backups: 50
|
||||
|
||||
registry:
|
||||
registry_address:
|
||||
- consul.kl.suyiiyii.top:80
|
||||
username: ""
|
||||
password: ""
|
||||
|
||||
mysql:
|
||||
dsn: "%s:%s@tcp(%s:%s)/user?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
|
||||
redis:
|
||||
address: "127.0.0.1:6379"
|
||||
username: ""
|
||||
password: ""
|
||||
db: 0
|
23
app/auth/conf/online/conf.yaml
Normal file
23
app/auth/conf/online/conf.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
kitex:
|
||||
service: "auth"
|
||||
address: ":8888"
|
||||
log_level: info
|
||||
log_file_name: "log/kitex.log"
|
||||
log_max_size: 10
|
||||
log_max_age: 3
|
||||
log_max_backups: 50
|
||||
|
||||
registry:
|
||||
registry_address:
|
||||
- consul.kl.suyiiyii.top:80
|
||||
username: ""
|
||||
password: ""
|
||||
|
||||
mysql:
|
||||
dsn: "%s:%s@tcp(%s:%s)/user?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
|
||||
redis:
|
||||
address: "127.0.0.1:6379"
|
||||
username: ""
|
||||
password: ""
|
||||
db: 0
|
23
app/auth/conf/test/conf.yaml
Normal file
23
app/auth/conf/test/conf.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
kitex:
|
||||
service: "auth"
|
||||
address: ":8888"
|
||||
log_level: info
|
||||
log_file_name: "log/kitex.log"
|
||||
log_max_size: 10
|
||||
log_max_age: 3
|
||||
log_max_backups: 50
|
||||
|
||||
registry:
|
||||
registry_address:
|
||||
- consul.kl.suyiiyii.top:80
|
||||
username: ""
|
||||
password: ""
|
||||
|
||||
mysql:
|
||||
dsn: "%s:%s@tcp(%s:%s)/user?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
|
||||
redis:
|
||||
address: "127.0.0.1:6379"
|
||||
username: ""
|
||||
password: ""
|
||||
db: 0
|
15
app/auth/docker-compose.yaml
Normal file
15
app/auth/docker-compose.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
version: '3'
|
||||
services:
|
||||
mysql:
|
||||
image: 'mysql:latest'
|
||||
ports:
|
||||
- 3306:3306
|
||||
environment:
|
||||
- MYSQL_DATABASE=gorm
|
||||
- MYSQL_USER=gorm
|
||||
- MYSQL_PASSWORD=gorm
|
||||
- MYSQL_RANDOM_ROOT_PASSWORD="yes"
|
||||
redis:
|
||||
image: 'redis:latest'
|
||||
ports:
|
||||
- 6379:6379
|
71
app/auth/go.mod
Normal file
71
app/auth/go.mod
Normal file
@ -0,0 +1,71 @@
|
||||
module github.com/suyiiyii/hertz101/app/auth
|
||||
|
||||
go 1.23.4
|
||||
|
||||
replace github.com/apache/thrift => github.com/apache/thrift v0.13.0
|
||||
|
||||
require (
|
||||
github.com/cloudwego/fastpb v0.0.5
|
||||
github.com/cloudwego/kitex v0.12.1
|
||||
github.com/kitex-contrib/obs-opentelemetry/logging/logrus v0.0.0-20241120035129-55da83caab1b
|
||||
github.com/kr/pretty v0.3.1
|
||||
github.com/redis/go-redis/v9 v9.7.0
|
||||
go.uber.org/zap v1.27.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gopkg.in/validator.v2 v2.0.1
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gorm.io/driver/mysql v1.5.7
|
||||
gorm.io/gorm v1.25.12
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/bytedance/gopkg v0.1.1 // indirect
|
||||
github.com/bytedance/sonic v1.12.5 // indirect
|
||||
github.com/bytedance/sonic/loader v0.2.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.4 // indirect
|
||||
github.com/cloudwego/configmanager v0.2.2 // indirect
|
||||
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f // indirect
|
||||
github.com/cloudwego/frugal v0.2.3 // indirect
|
||||
github.com/cloudwego/gopkg v0.1.3 // indirect
|
||||
github.com/cloudwego/iasm v0.2.0 // indirect
|
||||
github.com/cloudwego/localsession v0.1.1 // indirect
|
||||
github.com/cloudwego/netpoll v0.6.5 // indirect
|
||||
github.com/cloudwego/runtimex v0.1.0 // indirect
|
||||
github.com/cloudwego/thriftgo v0.3.18 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/fatih/structtag v1.2.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
|
||||
github.com/iancoleman/strcase v0.2.0 // indirect
|
||||
github.com/jhump/protoreflect v1.8.2 // 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/klauspost/cpuid/v2 v2.2.4 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
|
||||
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.2 // indirect
|
||||
github.com/stretchr/testify v1.9.0 // indirect
|
||||
github.com/tidwall/gjson v1.17.3 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
go.opentelemetry.io/otel v1.25.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.25.0 // indirect
|
||||
go.uber.org/multierr v1.10.0 // indirect
|
||||
golang.org/x/arch v0.2.0 // indirect
|
||||
golang.org/x/net v0.24.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.19.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
315
app/auth/go.sum
Normal file
315
app/auth/go.sum
Normal file
@ -0,0 +1,315 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
|
||||
github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ=
|
||||
github.com/bytedance/gopkg v0.1.0/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ=
|
||||
github.com/bytedance/gopkg v0.1.1 h1:3azzgSkiaw79u24a+w9arfH8OfnQQ4MHUt9lJFREEaE=
|
||||
github.com/bytedance/gopkg v0.1.1/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
|
||||
github.com/bytedance/sonic v1.12.5 h1:hoZxY8uW+mT+OpkcUWw4k0fDINtOcVavEsGfzwzFU/w=
|
||||
github.com/bytedance/sonic v1.12.5/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM=
|
||||
github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
|
||||
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
||||
github.com/cloudwego/configmanager v0.2.2 h1:sVrJB8gWYTlPV2OS3wcgJSO9F2/9Zbkmcm1Z7jempOU=
|
||||
github.com/cloudwego/configmanager v0.2.2/go.mod h1:ppiyU+5TPLonE8qMVi/pFQk2eL3Q4P7d4hbiNJn6jwI=
|
||||
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f h1:IERXjxDg3Pbatb5z/dR8Qr8XUA1FpDVa73BnwbeQ76U=
|
||||
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f/go.mod h1:DknfxjIMuGvXow409bS/AWycXONdc02HECBL0qpNqTY=
|
||||
github.com/cloudwego/fastpb v0.0.5 h1:vYnBPsfbAtU5TVz5+f9UTlmSCixG9F9vRwaqE0mZPZU=
|
||||
github.com/cloudwego/fastpb v0.0.5/go.mod h1:Bho7aAKBUtT9RPD2cNVkTdx4yQumfSv3If7wYnm1izk=
|
||||
github.com/cloudwego/frugal v0.2.3 h1:t1hhhAi8lXcx7Ncs4PR1pSZ90vlDU1cy5K2btDMFpoA=
|
||||
github.com/cloudwego/frugal v0.2.3/go.mod h1:nC1U47gswLRiaxv6dybrhZvsDGCfQP9RGiiWC73CnoI=
|
||||
github.com/cloudwego/gopkg v0.1.3 h1:y9VA5Zn5yqd1+QBV9aB0Zxy56JlAS7x4ZUoED/vJdxA=
|
||||
github.com/cloudwego/gopkg v0.1.3/go.mod h1:FQuXsRWRsSqJLsMVd5SYzp8/Z1y5gXKnVvRrWUOsCMI=
|
||||
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||
github.com/cloudwego/kitex v0.12.1 h1:Ib+RWDRzXNz/9mObZmWasjFgrIVNrLSyvMveFDA2tTM=
|
||||
github.com/cloudwego/kitex v0.12.1/go.mod h1:o9Vaz/Kpu0uAj7go0+0jq3hr4e+Im/BunlmhnUAyqkQ=
|
||||
github.com/cloudwego/localsession v0.1.1 h1:tbK7laDVrYfFDXoBXo4uCGMAxU4qmz2dDm8d4BGBnDo=
|
||||
github.com/cloudwego/localsession v0.1.1/go.mod h1:kiJxmvAcy4PLgKtEnPS5AXed3xCiXcs7Z+KBHP72Wv8=
|
||||
github.com/cloudwego/netpoll v0.6.5 h1:6E/BWhSzQoyLg9Kx/4xiMdIIpovzwBtXvuqSqaTUzDQ=
|
||||
github.com/cloudwego/netpoll v0.6.5/go.mod h1:BtM+GjKTdwKoC8IOzD08/+8eEn2gYoiNLipFca6BVXQ=
|
||||
github.com/cloudwego/runtimex v0.1.0 h1:HG+WxWoj5/CDChDZ7D99ROwvSMkuNXAqt6hnhTTZDiI=
|
||||
github.com/cloudwego/runtimex v0.1.0/go.mod h1:23vL/HGV0W8nSCHbe084AgEBdDV4rvXenEUMnUNvUd8=
|
||||
github.com/cloudwego/thriftgo v0.3.18 h1:gnr1vz7G3RbwwCK9AMKHZf63VYGa7ene6WbI9VrBJSw=
|
||||
github.com/cloudwego/thriftgo v0.3.18/go.mod h1:AdLEJJVGW/ZJYvkkYAZf5SaJH+pA3OyC801WSwqcBwI=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
|
||||
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
|
||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
|
||||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
|
||||
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
|
||||
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
|
||||
github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0=
|
||||
github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kitex-contrib/obs-opentelemetry/logging/logrus v0.0.0-20241120035129-55da83caab1b h1:PUdDbnTeBtUOiA+KiEwnECD5qECWvWCD68XTYPIWfEI=
|
||||
github.com/kitex-contrib/obs-opentelemetry/logging/logrus v0.0.0-20241120035129-55da83caab1b/go.mod h1:RyQpX16txMOmC2a4yykhF1P50nzbHVnKnI/T0jA1ZOg=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
|
||||
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 h1:uiS4zKYKJVj5F3ID+5iylfKPsEQmBEOucSD9Vgmn0i0=
|
||||
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5/go.mod h1:I8AX+yW//L8Hshx6+a1m3bYkwXkpsVjA2795vP4f4oQ=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
|
||||
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
|
||||
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94=
|
||||
github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k=
|
||||
go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg=
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 h1:+XWJd3jf75RXJq29mxbuXhCXFDG3S3R4vBUeSI2P7tE=
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0/go.mod h1:hqgzBPTf4yONMFgdZvL/bK42R/iinTyVQtiWihs3SZc=
|
||||
go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA=
|
||||
go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s=
|
||||
go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo=
|
||||
go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw=
|
||||
go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM=
|
||||
go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
|
||||
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||
golang.org/x/arch v0.2.0 h1:W1sUEHXiJTfjaFJ5SLo0N6lZn+0eO5gWD1MFeTGqQEY=
|
||||
golang.org/x/arch v0.2.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384 h1:z+j74wi4yV+P7EtK9gPLGukOk7mFOy9wMQaC0wNb7eY=
|
||||
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.36.1 h1:cmUfbeGKnz9+2DD/UYsMQXeqbHZqZDs4eQwW0sFOpBY=
|
||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
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.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=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
|
||||
gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
|
||||
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
|
||||
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
24
app/auth/handler.go
Normal file
24
app/auth/handler.go
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
"github.com/suyiiyii/hertz101/app/auth/biz/service"
|
||||
)
|
||||
|
||||
// AuthServiceImpl implements the last service interface defined in the IDL.
|
||||
type AuthServiceImpl struct{}
|
||||
|
||||
// DeliverTokenByRPC implements the AuthServiceImpl interface.
|
||||
func (s *AuthServiceImpl) DeliverTokenByRPC(ctx context.Context, req *auth.DeliverTokenReq) (resp *auth.DeliveryResp, err error) {
|
||||
resp, err = service.NewDeliverTokenByRPCService(ctx).Run(req)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// VerifyTokenByRPC implements the AuthServiceImpl interface.
|
||||
func (s *AuthServiceImpl) VerifyTokenByRPC(ctx context.Context, req *auth.VerifyTokenReq) (resp *auth.VerifyResp, err error) {
|
||||
resp, err = service.NewVerifyTokenByRPCService(ctx).Run(req)
|
||||
|
||||
return resp, err
|
||||
}
|
257
app/auth/kitex_gen/auth/auth.pb.fast.go
Normal file
257
app/auth/kitex_gen/auth/auth.pb.fast.go
Normal file
@ -0,0 +1,257 @@
|
||||
// Code generated by Fastpb v0.0.2. DO NOT EDIT.
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
fastpb "github.com/cloudwego/fastpb"
|
||||
)
|
||||
|
||||
var (
|
||||
_ = fmt.Errorf
|
||||
_ = fastpb.Skip
|
||||
)
|
||||
|
||||
func (x *DeliverTokenReq) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_DeliverTokenReq[number], err)
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.UserId, offset, err = fastpb.ReadInt32(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_VerifyTokenReq[number], err)
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Token, offset, err = fastpb.ReadString(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_DeliveryResp[number], err)
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Token, offset, err = fastpb.ReadString(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *VerifyResp) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_VerifyResp[number], err)
|
||||
}
|
||||
|
||||
func (x *VerifyResp) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Res, offset, err = fastpb.ReadBool(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.UserId == 0 {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteInt32(buf[offset:], 1, x.GetUserId())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.Token == "" {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteString(buf[offset:], 1, x.GetToken())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.Token == "" {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteString(buf[offset:], 1, x.GetToken())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyResp) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyResp) fastWriteField1(buf []byte) (offset int) {
|
||||
if !x.Res {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteBool(buf[offset:], 1, x.GetRes())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) sizeField1() (n int) {
|
||||
if x.UserId == 0 {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeInt32(1, x.GetUserId())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) sizeField1() (n int) {
|
||||
if x.Token == "" {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeString(1, x.GetToken())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) sizeField1() (n int) {
|
||||
if x.Token == "" {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeString(1, x.GetToken())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyResp) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyResp) sizeField1() (n int) {
|
||||
if !x.Res {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeBool(1, x.GetRes())
|
||||
return n
|
||||
}
|
||||
|
||||
var fieldIDToName_DeliverTokenReq = map[int32]string{
|
||||
1: "UserId",
|
||||
}
|
||||
|
||||
var fieldIDToName_VerifyTokenReq = map[int32]string{
|
||||
1: "Token",
|
||||
}
|
||||
|
||||
var fieldIDToName_DeliveryResp = map[int32]string{
|
||||
1: "Token",
|
||||
}
|
||||
|
||||
var fieldIDToName_VerifyResp = map[int32]string{
|
||||
1: "Res",
|
||||
}
|
354
app/auth/kitex_gen/auth/auth.pb.go
Normal file
354
app/auth/kitex_gen/auth/auth.pb.go
Normal file
@ -0,0 +1,354 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v5.29.2
|
||||
// source: auth.proto
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
context "context"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type DeliverTokenReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserId int32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) Reset() {
|
||||
*x = DeliverTokenReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeliverTokenReq) ProtoMessage() {}
|
||||
|
||||
func (x *DeliverTokenReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeliverTokenReq.ProtoReflect.Descriptor instead.
|
||||
func (*DeliverTokenReq) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) GetUserId() int32 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type VerifyTokenReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) Reset() {
|
||||
*x = VerifyTokenReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VerifyTokenReq) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyTokenReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VerifyTokenReq.ProtoReflect.Descriptor instead.
|
||||
func (*VerifyTokenReq) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeliveryResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) Reset() {
|
||||
*x = DeliveryResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeliveryResp) ProtoMessage() {}
|
||||
|
||||
func (x *DeliveryResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeliveryResp.ProtoReflect.Descriptor instead.
|
||||
func (*DeliveryResp) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type VerifyResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Res bool `protobuf:"varint,1,opt,name=res,proto3" json:"res,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VerifyResp) Reset() {
|
||||
*x = VerifyResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VerifyResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VerifyResp) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VerifyResp.ProtoReflect.Descriptor instead.
|
||||
func (*VerifyResp) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *VerifyResp) GetRes() bool {
|
||||
if x != nil {
|
||||
return x.Res
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x61, 0x75,
|
||||
0x74, 0x68, 0x22, 0x2a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x26,
|
||||
0x0a, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x24, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65,
|
||||
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1e, 0x0a, 0x0a,
|
||||
0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65,
|
||||
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x65, 0x73, 0x32, 0x8d, 0x01, 0x0a,
|
||||
0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x11,
|
||||
0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x52, 0x50,
|
||||
0x43, 0x12, 0x15, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
|
||||
0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c,
|
||||
0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x52,
|
||||
0x50, 0x43, 0x12, 0x14, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
|
||||
0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x36, 0x5a, 0x34,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x75, 0x79, 0x69, 0x69,
|
||||
0x79, 0x69, 0x69, 0x2f, 0x68, 0x65, 0x72, 0x74, 0x7a, 0x31, 0x30, 0x31, 0x2f, 0x61, 0x70, 0x70,
|
||||
0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6b, 0x69, 0x74, 0x65, 0x78, 0x5f, 0x67, 0x65, 0x6e, 0x2f,
|
||||
0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_auth_proto_rawDescOnce sync.Once
|
||||
file_auth_proto_rawDescData = file_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_auth_proto_rawDescGZIP() []byte {
|
||||
file_auth_proto_rawDescOnce.Do(func() {
|
||||
file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_auth_proto_rawDescData)
|
||||
})
|
||||
return file_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_auth_proto_goTypes = []interface{}{
|
||||
(*DeliverTokenReq)(nil), // 0: auth.DeliverTokenReq
|
||||
(*VerifyTokenReq)(nil), // 1: auth.VerifyTokenReq
|
||||
(*DeliveryResp)(nil), // 2: auth.DeliveryResp
|
||||
(*VerifyResp)(nil), // 3: auth.VerifyResp
|
||||
}
|
||||
var file_auth_proto_depIdxs = []int32{
|
||||
0, // 0: auth.AuthService.DeliverTokenByRPC:input_type -> auth.DeliverTokenReq
|
||||
1, // 1: auth.AuthService.VerifyTokenByRPC:input_type -> auth.VerifyTokenReq
|
||||
2, // 2: auth.AuthService.DeliverTokenByRPC:output_type -> auth.DeliveryResp
|
||||
3, // 3: auth.AuthService.VerifyTokenByRPC:output_type -> auth.VerifyResp
|
||||
2, // [2:4] is the sub-list for method output_type
|
||||
0, // [0:2] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_auth_proto_init() }
|
||||
func file_auth_proto_init() {
|
||||
if File_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeliverTokenReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyTokenReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeliveryResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_auth_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_auth_proto_goTypes,
|
||||
DependencyIndexes: file_auth_proto_depIdxs,
|
||||
MessageInfos: file_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_auth_proto = out.File
|
||||
file_auth_proto_rawDesc = nil
|
||||
file_auth_proto_goTypes = nil
|
||||
file_auth_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
var _ context.Context
|
||||
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
type AuthService interface {
|
||||
DeliverTokenByRPC(ctx context.Context, req *DeliverTokenReq) (res *DeliveryResp, err error)
|
||||
VerifyTokenByRPC(ctx context.Context, req *VerifyTokenReq) (res *VerifyResp, err error)
|
||||
}
|
432
app/auth/kitex_gen/auth/authservice/authservice.go
Normal file
432
app/auth/kitex_gen/auth/authservice/authservice.go
Normal file
@ -0,0 +1,432 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
client "github.com/cloudwego/kitex/client"
|
||||
kitex "github.com/cloudwego/kitex/pkg/serviceinfo"
|
||||
streaming "github.com/cloudwego/kitex/pkg/streaming"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var errInvalidMessageType = errors.New("invalid message type for service method handler")
|
||||
|
||||
var serviceMethods = map[string]kitex.MethodInfo{
|
||||
"DeliverTokenByRPC": kitex.NewMethodInfo(
|
||||
deliverTokenByRPCHandler,
|
||||
newDeliverTokenByRPCArgs,
|
||||
newDeliverTokenByRPCResult,
|
||||
false,
|
||||
kitex.WithStreamingMode(kitex.StreamingUnary),
|
||||
),
|
||||
"VerifyTokenByRPC": kitex.NewMethodInfo(
|
||||
verifyTokenByRPCHandler,
|
||||
newVerifyTokenByRPCArgs,
|
||||
newVerifyTokenByRPCResult,
|
||||
false,
|
||||
kitex.WithStreamingMode(kitex.StreamingUnary),
|
||||
),
|
||||
}
|
||||
|
||||
var (
|
||||
authServiceServiceInfo = NewServiceInfo()
|
||||
authServiceServiceInfoForClient = NewServiceInfoForClient()
|
||||
authServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient()
|
||||
)
|
||||
|
||||
// for server
|
||||
func serviceInfo() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfo
|
||||
}
|
||||
|
||||
// for client
|
||||
func serviceInfoForStreamClient() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfoForStreamClient
|
||||
}
|
||||
|
||||
// for stream client
|
||||
func serviceInfoForClient() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfoForClient
|
||||
}
|
||||
|
||||
// NewServiceInfo creates a new ServiceInfo containing all methods
|
||||
func NewServiceInfo() *kitex.ServiceInfo {
|
||||
return newServiceInfo(false, true, true)
|
||||
}
|
||||
|
||||
// NewServiceInfo creates a new ServiceInfo containing non-streaming methods
|
||||
func NewServiceInfoForClient() *kitex.ServiceInfo {
|
||||
return newServiceInfo(false, false, true)
|
||||
}
|
||||
func NewServiceInfoForStreamClient() *kitex.ServiceInfo {
|
||||
return newServiceInfo(true, true, false)
|
||||
}
|
||||
|
||||
func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo {
|
||||
serviceName := "AuthService"
|
||||
handlerType := (*auth.AuthService)(nil)
|
||||
methods := map[string]kitex.MethodInfo{}
|
||||
for name, m := range serviceMethods {
|
||||
if m.IsStreaming() && !keepStreamingMethods {
|
||||
continue
|
||||
}
|
||||
if !m.IsStreaming() && !keepNonStreamingMethods {
|
||||
continue
|
||||
}
|
||||
methods[name] = m
|
||||
}
|
||||
extra := map[string]interface{}{
|
||||
"PackageName": "auth",
|
||||
}
|
||||
if hasStreaming {
|
||||
extra["streaming"] = hasStreaming
|
||||
}
|
||||
svcInfo := &kitex.ServiceInfo{
|
||||
ServiceName: serviceName,
|
||||
HandlerType: handlerType,
|
||||
Methods: methods,
|
||||
PayloadCodec: kitex.Protobuf,
|
||||
KiteXGenVersion: "v0.9.1",
|
||||
Extra: extra,
|
||||
}
|
||||
return svcInfo
|
||||
}
|
||||
|
||||
func deliverTokenByRPCHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
|
||||
switch s := arg.(type) {
|
||||
case *streaming.Args:
|
||||
st := s.Stream
|
||||
req := new(auth.DeliverTokenReq)
|
||||
if err := st.RecvMsg(req); err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := handler.(auth.AuthService).DeliverTokenByRPC(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return st.SendMsg(resp)
|
||||
case *DeliverTokenByRPCArgs:
|
||||
success, err := handler.(auth.AuthService).DeliverTokenByRPC(ctx, s.Req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
realResult := result.(*DeliverTokenByRPCResult)
|
||||
realResult.Success = success
|
||||
return nil
|
||||
default:
|
||||
return errInvalidMessageType
|
||||
}
|
||||
}
|
||||
func newDeliverTokenByRPCArgs() interface{} {
|
||||
return &DeliverTokenByRPCArgs{}
|
||||
}
|
||||
|
||||
func newDeliverTokenByRPCResult() interface{} {
|
||||
return &DeliverTokenByRPCResult{}
|
||||
}
|
||||
|
||||
type DeliverTokenByRPCArgs struct {
|
||||
Req *auth.DeliverTokenReq
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetReq() {
|
||||
p.Req = new(auth.DeliverTokenReq)
|
||||
}
|
||||
return p.Req.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Size() (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.Size()
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetReq() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Req)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Unmarshal(in []byte) error {
|
||||
msg := new(auth.DeliverTokenReq)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Req = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
var DeliverTokenByRPCArgs_Req_DEFAULT *auth.DeliverTokenReq
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) GetReq() *auth.DeliverTokenReq {
|
||||
if !p.IsSetReq() {
|
||||
return DeliverTokenByRPCArgs_Req_DEFAULT
|
||||
}
|
||||
return p.Req
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) IsSetReq() bool {
|
||||
return p.Req != nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) GetFirstArgument() interface{} {
|
||||
return p.Req
|
||||
}
|
||||
|
||||
type DeliverTokenByRPCResult struct {
|
||||
Success *auth.DeliveryResp
|
||||
}
|
||||
|
||||
var DeliverTokenByRPCResult_Success_DEFAULT *auth.DeliveryResp
|
||||
|
||||
func (p *DeliverTokenByRPCResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetSuccess() {
|
||||
p.Success = new(auth.DeliveryResp)
|
||||
}
|
||||
return p.Success.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Size() (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.Size()
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetSuccess() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Success)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Unmarshal(in []byte) error {
|
||||
msg := new(auth.DeliveryResp)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Success = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) GetSuccess() *auth.DeliveryResp {
|
||||
if !p.IsSetSuccess() {
|
||||
return DeliverTokenByRPCResult_Success_DEFAULT
|
||||
}
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) SetSuccess(x interface{}) {
|
||||
p.Success = x.(*auth.DeliveryResp)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) IsSetSuccess() bool {
|
||||
return p.Success != nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) GetResult() interface{} {
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func verifyTokenByRPCHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
|
||||
switch s := arg.(type) {
|
||||
case *streaming.Args:
|
||||
st := s.Stream
|
||||
req := new(auth.VerifyTokenReq)
|
||||
if err := st.RecvMsg(req); err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := handler.(auth.AuthService).VerifyTokenByRPC(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return st.SendMsg(resp)
|
||||
case *VerifyTokenByRPCArgs:
|
||||
success, err := handler.(auth.AuthService).VerifyTokenByRPC(ctx, s.Req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
realResult := result.(*VerifyTokenByRPCResult)
|
||||
realResult.Success = success
|
||||
return nil
|
||||
default:
|
||||
return errInvalidMessageType
|
||||
}
|
||||
}
|
||||
func newVerifyTokenByRPCArgs() interface{} {
|
||||
return &VerifyTokenByRPCArgs{}
|
||||
}
|
||||
|
||||
func newVerifyTokenByRPCResult() interface{} {
|
||||
return &VerifyTokenByRPCResult{}
|
||||
}
|
||||
|
||||
type VerifyTokenByRPCArgs struct {
|
||||
Req *auth.VerifyTokenReq
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetReq() {
|
||||
p.Req = new(auth.VerifyTokenReq)
|
||||
}
|
||||
return p.Req.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Size() (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.Size()
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetReq() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Req)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Unmarshal(in []byte) error {
|
||||
msg := new(auth.VerifyTokenReq)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Req = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
var VerifyTokenByRPCArgs_Req_DEFAULT *auth.VerifyTokenReq
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) GetReq() *auth.VerifyTokenReq {
|
||||
if !p.IsSetReq() {
|
||||
return VerifyTokenByRPCArgs_Req_DEFAULT
|
||||
}
|
||||
return p.Req
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) IsSetReq() bool {
|
||||
return p.Req != nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) GetFirstArgument() interface{} {
|
||||
return p.Req
|
||||
}
|
||||
|
||||
type VerifyTokenByRPCResult struct {
|
||||
Success *auth.VerifyResp
|
||||
}
|
||||
|
||||
var VerifyTokenByRPCResult_Success_DEFAULT *auth.VerifyResp
|
||||
|
||||
func (p *VerifyTokenByRPCResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetSuccess() {
|
||||
p.Success = new(auth.VerifyResp)
|
||||
}
|
||||
return p.Success.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Size() (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.Size()
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetSuccess() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Success)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Unmarshal(in []byte) error {
|
||||
msg := new(auth.VerifyResp)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Success = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) GetSuccess() *auth.VerifyResp {
|
||||
if !p.IsSetSuccess() {
|
||||
return VerifyTokenByRPCResult_Success_DEFAULT
|
||||
}
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) SetSuccess(x interface{}) {
|
||||
p.Success = x.(*auth.VerifyResp)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) IsSetSuccess() bool {
|
||||
return p.Success != nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) GetResult() interface{} {
|
||||
return p.Success
|
||||
}
|
||||
|
||||
type kClient struct {
|
||||
c client.Client
|
||||
}
|
||||
|
||||
func newServiceClient(c client.Client) *kClient {
|
||||
return &kClient{
|
||||
c: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *kClient) DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq) (r *auth.DeliveryResp, err error) {
|
||||
var _args DeliverTokenByRPCArgs
|
||||
_args.Req = Req
|
||||
var _result DeliverTokenByRPCResult
|
||||
if err = p.c.Call(ctx, "DeliverTokenByRPC", &_args, &_result); err != nil {
|
||||
return
|
||||
}
|
||||
return _result.GetSuccess(), nil
|
||||
}
|
||||
|
||||
func (p *kClient) VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq) (r *auth.VerifyResp, err error) {
|
||||
var _args VerifyTokenByRPCArgs
|
||||
_args.Req = Req
|
||||
var _result VerifyTokenByRPCResult
|
||||
if err = p.c.Call(ctx, "VerifyTokenByRPC", &_args, &_result); err != nil {
|
||||
return
|
||||
}
|
||||
return _result.GetSuccess(), nil
|
||||
}
|
55
app/auth/kitex_gen/auth/authservice/client.go
Normal file
55
app/auth/kitex_gen/auth/authservice/client.go
Normal file
@ -0,0 +1,55 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
client "github.com/cloudwego/kitex/client"
|
||||
callopt "github.com/cloudwego/kitex/client/callopt"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.
|
||||
type Client interface {
|
||||
DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error)
|
||||
VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error)
|
||||
}
|
||||
|
||||
// NewClient creates a client for the service defined in IDL.
|
||||
func NewClient(destService string, opts ...client.Option) (Client, error) {
|
||||
var options []client.Option
|
||||
options = append(options, client.WithDestService(destService))
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
kc, err := client.NewClient(serviceInfo(), options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &kAuthServiceClient{
|
||||
kClient: newServiceClient(kc),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs.
|
||||
func MustNewClient(destService string, opts ...client.Option) Client {
|
||||
kc, err := NewClient(destService, opts...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return kc
|
||||
}
|
||||
|
||||
type kAuthServiceClient struct {
|
||||
*kClient
|
||||
}
|
||||
|
||||
func (p *kAuthServiceClient) DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error) {
|
||||
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
|
||||
return p.kClient.DeliverTokenByRPC(ctx, Req)
|
||||
}
|
||||
|
||||
func (p *kAuthServiceClient) VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error) {
|
||||
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
|
||||
return p.kClient.VerifyTokenByRPC(ctx, Req)
|
||||
}
|
24
app/auth/kitex_gen/auth/authservice/invoker.go
Normal file
24
app/auth/kitex_gen/auth/authservice/invoker.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
server "github.com/cloudwego/kitex/server"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// NewInvoker creates a server.Invoker with the given handler and options.
|
||||
func NewInvoker(handler auth.AuthService, opts ...server.Option) server.Invoker {
|
||||
var options []server.Option
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
s := server.NewInvoker(options...)
|
||||
if err := s.RegisterService(serviceInfo(), handler); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := s.Init(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return s
|
||||
}
|
24
app/auth/kitex_gen/auth/authservice/server.go
Normal file
24
app/auth/kitex_gen/auth/authservice/server.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
package authservice
|
||||
|
||||
import (
|
||||
server "github.com/cloudwego/kitex/server"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// NewServer creates a server.Server with the given handler and options.
|
||||
func NewServer(handler auth.AuthService, opts ...server.Option) server.Server {
|
||||
var options []server.Option
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
svr := server.NewServer(options...)
|
||||
if err := svr.RegisterService(serviceInfo(), handler); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return svr
|
||||
}
|
||||
|
||||
func RegisterService(svr server.Server, handler auth.AuthService, opts ...server.RegisterOption) error {
|
||||
return svr.RegisterService(serviceInfo(), handler, opts...)
|
||||
}
|
3
app/auth/kitex_info.yaml
Normal file
3
app/auth/kitex_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
kitexinfo:
|
||||
ServiceName: 'auth'
|
||||
ToolVersion: 'v0.9.1'
|
68
app/auth/main.go
Normal file
68
app/auth/main.go
Normal file
@ -0,0 +1,68 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
consul "github.com/kitex-contrib/registry-consul"
|
||||
"github.com/suyiiyii/hertz101/app/auth/biz/dal"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/cloudwego/kitex/pkg/klog"
|
||||
"github.com/cloudwego/kitex/pkg/rpcinfo"
|
||||
"github.com/cloudwego/kitex/server"
|
||||
kitexlogrus "github.com/kitex-contrib/obs-opentelemetry/logging/logrus"
|
||||
"github.com/suyiiyii/hertz101/app/auth/conf"
|
||||
"github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth/authservice"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
dal.Init()
|
||||
opts := kitexInit()
|
||||
|
||||
svr := authservice.NewServer(new(AuthServiceImpl), opts...)
|
||||
|
||||
err := svr.Run()
|
||||
if err != nil {
|
||||
klog.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func kitexInit() (opts []server.Option) {
|
||||
// address
|
||||
addr, err := net.ResolveTCPAddr("tcp", conf.GetConf().Kitex.Address)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
opts = append(opts, server.WithServiceAddr(addr))
|
||||
|
||||
// service info
|
||||
opts = append(opts, server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{
|
||||
ServiceName: conf.GetConf().Kitex.Service,
|
||||
}))
|
||||
|
||||
r, err := consul.NewConsulRegister(conf.GetConf().Registry.RegistryAddress[0])
|
||||
if err != nil {
|
||||
klog.Fatal(err)
|
||||
}
|
||||
opts = append(opts, server.WithRegistry(r))
|
||||
|
||||
// klog
|
||||
logger := kitexlogrus.NewLogger()
|
||||
klog.SetLogger(logger)
|
||||
klog.SetLevel(conf.LogLevel())
|
||||
asyncWriter := &zapcore.BufferedWriteSyncer{
|
||||
WS: zapcore.AddSync(&lumberjack.Logger{
|
||||
Filename: conf.GetConf().Kitex.LogFileName,
|
||||
MaxSize: conf.GetConf().Kitex.LogMaxSize,
|
||||
MaxBackups: conf.GetConf().Kitex.LogMaxBackups,
|
||||
MaxAge: conf.GetConf().Kitex.LogMaxAge,
|
||||
}),
|
||||
FlushInterval: time.Minute,
|
||||
}
|
||||
klog.SetOutput(asyncWriter)
|
||||
server.RegisterShutdownHook(func() {
|
||||
asyncWriter.Sync()
|
||||
})
|
||||
return
|
||||
}
|
26
app/auth/readme.md
Normal file
26
app/auth/readme.md
Normal file
@ -0,0 +1,26 @@
|
||||
# *** Project
|
||||
|
||||
## introduce
|
||||
|
||||
- Use the [Kitex](https://github.com/cloudwego/kitex/) framework
|
||||
- Generating the base code for unit tests.
|
||||
- Provides basic config functions
|
||||
- Provides the most basic MVC code hierarchy.
|
||||
|
||||
## Directory structure
|
||||
|
||||
| catalog | introduce |
|
||||
| ---- | ---- |
|
||||
| conf | Configuration files |
|
||||
| main.go | Startup file |
|
||||
| handler.go | Used for request processing return of response. |
|
||||
| kitex_gen | kitex generated code |
|
||||
| biz/service | The actual business logic. |
|
||||
| biz/dal | Logic for operating the storage layer |
|
||||
|
||||
## How to run
|
||||
|
||||
```shell
|
||||
sh build.sh
|
||||
sh output/bootstrap.sh
|
||||
```
|
4
app/auth/script/bootstrap.sh
Normal file
4
app/auth/script/bootstrap.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#! /usr/bin/env bash
|
||||
CURDIR=$(cd $(dirname $0); pwd)
|
||||
echo "$CURDIR/bin/auth"
|
||||
exec "$CURDIR/bin/auth"
|
26
idl/auth.proto
Normal file
26
idl/auth.proto
Normal file
@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package auth;
|
||||
|
||||
option go_package = "/auth";
|
||||
|
||||
service AuthService {
|
||||
rpc DeliverTokenByRPC(DeliverTokenReq) returns (DeliveryResp) {}
|
||||
rpc VerifyTokenByRPC(VerifyTokenReq) returns (VerifyResp) {}
|
||||
}
|
||||
|
||||
message DeliverTokenReq {
|
||||
int32 user_id = 1;
|
||||
}
|
||||
|
||||
message VerifyTokenReq {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message DeliveryResp {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message VerifyResp {
|
||||
bool res = 1;
|
||||
}
|
257
rpc_gen/kitex_gen/auth/auth.pb.fast.go
Normal file
257
rpc_gen/kitex_gen/auth/auth.pb.fast.go
Normal file
@ -0,0 +1,257 @@
|
||||
// Code generated by Fastpb v0.0.2. DO NOT EDIT.
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
fastpb "github.com/cloudwego/fastpb"
|
||||
)
|
||||
|
||||
var (
|
||||
_ = fmt.Errorf
|
||||
_ = fastpb.Skip
|
||||
)
|
||||
|
||||
func (x *DeliverTokenReq) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_DeliverTokenReq[number], err)
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.UserId, offset, err = fastpb.ReadInt32(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_VerifyTokenReq[number], err)
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Token, offset, err = fastpb.ReadString(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_DeliveryResp[number], err)
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Token, offset, err = fastpb.ReadString(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *VerifyResp) FastRead(buf []byte, _type int8, number int32) (offset int, err error) {
|
||||
switch number {
|
||||
case 1:
|
||||
offset, err = x.fastReadField1(buf, _type)
|
||||
if err != nil {
|
||||
goto ReadFieldError
|
||||
}
|
||||
default:
|
||||
offset, err = fastpb.Skip(buf, _type, number)
|
||||
if err != nil {
|
||||
goto SkipFieldError
|
||||
}
|
||||
}
|
||||
return offset, nil
|
||||
SkipFieldError:
|
||||
return offset, fmt.Errorf("%T cannot parse invalid wire-format data, error: %s", x, err)
|
||||
ReadFieldError:
|
||||
return offset, fmt.Errorf("%T read field %d '%s' error: %s", x, number, fieldIDToName_VerifyResp[number], err)
|
||||
}
|
||||
|
||||
func (x *VerifyResp) fastReadField1(buf []byte, _type int8) (offset int, err error) {
|
||||
x.Res, offset, err = fastpb.ReadBool(buf, _type)
|
||||
return offset, err
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.UserId == 0 {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteInt32(buf[offset:], 1, x.GetUserId())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.Token == "" {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteString(buf[offset:], 1, x.GetToken())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) fastWriteField1(buf []byte) (offset int) {
|
||||
if x.Token == "" {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteString(buf[offset:], 1, x.GetToken())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyResp) FastWrite(buf []byte) (offset int) {
|
||||
if x == nil {
|
||||
return offset
|
||||
}
|
||||
offset += x.fastWriteField1(buf[offset:])
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *VerifyResp) fastWriteField1(buf []byte) (offset int) {
|
||||
if !x.Res {
|
||||
return offset
|
||||
}
|
||||
offset += fastpb.WriteBool(buf[offset:], 1, x.GetRes())
|
||||
return offset
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) sizeField1() (n int) {
|
||||
if x.UserId == 0 {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeInt32(1, x.GetUserId())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) sizeField1() (n int) {
|
||||
if x.Token == "" {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeString(1, x.GetToken())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) sizeField1() (n int) {
|
||||
if x.Token == "" {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeString(1, x.GetToken())
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyResp) Size() (n int) {
|
||||
if x == nil {
|
||||
return n
|
||||
}
|
||||
n += x.sizeField1()
|
||||
return n
|
||||
}
|
||||
|
||||
func (x *VerifyResp) sizeField1() (n int) {
|
||||
if !x.Res {
|
||||
return n
|
||||
}
|
||||
n += fastpb.SizeBool(1, x.GetRes())
|
||||
return n
|
||||
}
|
||||
|
||||
var fieldIDToName_DeliverTokenReq = map[int32]string{
|
||||
1: "UserId",
|
||||
}
|
||||
|
||||
var fieldIDToName_VerifyTokenReq = map[int32]string{
|
||||
1: "Token",
|
||||
}
|
||||
|
||||
var fieldIDToName_DeliveryResp = map[int32]string{
|
||||
1: "Token",
|
||||
}
|
||||
|
||||
var fieldIDToName_VerifyResp = map[int32]string{
|
||||
1: "Res",
|
||||
}
|
354
rpc_gen/kitex_gen/auth/auth.pb.go
Normal file
354
rpc_gen/kitex_gen/auth/auth.pb.go
Normal file
@ -0,0 +1,354 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v5.29.2
|
||||
// source: auth.proto
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
context "context"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type DeliverTokenReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserId int32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) Reset() {
|
||||
*x = DeliverTokenReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeliverTokenReq) ProtoMessage() {}
|
||||
|
||||
func (x *DeliverTokenReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeliverTokenReq.ProtoReflect.Descriptor instead.
|
||||
func (*DeliverTokenReq) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *DeliverTokenReq) GetUserId() int32 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type VerifyTokenReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) Reset() {
|
||||
*x = VerifyTokenReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VerifyTokenReq) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyTokenReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VerifyTokenReq.ProtoReflect.Descriptor instead.
|
||||
func (*VerifyTokenReq) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *VerifyTokenReq) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeliveryResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) Reset() {
|
||||
*x = DeliveryResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeliveryResp) ProtoMessage() {}
|
||||
|
||||
func (x *DeliveryResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeliveryResp.ProtoReflect.Descriptor instead.
|
||||
func (*DeliveryResp) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DeliveryResp) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type VerifyResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Res bool `protobuf:"varint,1,opt,name=res,proto3" json:"res,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VerifyResp) Reset() {
|
||||
*x = VerifyResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VerifyResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VerifyResp) ProtoMessage() {}
|
||||
|
||||
func (x *VerifyResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VerifyResp.ProtoReflect.Descriptor instead.
|
||||
func (*VerifyResp) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *VerifyResp) GetRes() bool {
|
||||
if x != nil {
|
||||
return x.Res
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x61, 0x75,
|
||||
0x74, 0x68, 0x22, 0x2a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x26,
|
||||
0x0a, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x24, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65,
|
||||
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1e, 0x0a, 0x0a,
|
||||
0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65,
|
||||
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x65, 0x73, 0x32, 0x8d, 0x01, 0x0a,
|
||||
0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x11,
|
||||
0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x52, 0x50,
|
||||
0x43, 0x12, 0x15, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
|
||||
0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c,
|
||||
0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x52,
|
||||
0x50, 0x43, 0x12, 0x14, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
|
||||
0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x75, 0x79, 0x69, 0x69,
|
||||
0x79, 0x69, 0x69, 0x2f, 0x68, 0x65, 0x72, 0x74, 0x7a, 0x31, 0x30, 0x31, 0x2f, 0x72, 0x70, 0x63,
|
||||
0x5f, 0x67, 0x65, 0x6e, 0x2f, 0x6b, 0x69, 0x74, 0x65, 0x78, 0x5f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
|
||||
0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_auth_proto_rawDescOnce sync.Once
|
||||
file_auth_proto_rawDescData = file_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_auth_proto_rawDescGZIP() []byte {
|
||||
file_auth_proto_rawDescOnce.Do(func() {
|
||||
file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_auth_proto_rawDescData)
|
||||
})
|
||||
return file_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_auth_proto_goTypes = []interface{}{
|
||||
(*DeliverTokenReq)(nil), // 0: auth.DeliverTokenReq
|
||||
(*VerifyTokenReq)(nil), // 1: auth.VerifyTokenReq
|
||||
(*DeliveryResp)(nil), // 2: auth.DeliveryResp
|
||||
(*VerifyResp)(nil), // 3: auth.VerifyResp
|
||||
}
|
||||
var file_auth_proto_depIdxs = []int32{
|
||||
0, // 0: auth.AuthService.DeliverTokenByRPC:input_type -> auth.DeliverTokenReq
|
||||
1, // 1: auth.AuthService.VerifyTokenByRPC:input_type -> auth.VerifyTokenReq
|
||||
2, // 2: auth.AuthService.DeliverTokenByRPC:output_type -> auth.DeliveryResp
|
||||
3, // 3: auth.AuthService.VerifyTokenByRPC:output_type -> auth.VerifyResp
|
||||
2, // [2:4] is the sub-list for method output_type
|
||||
0, // [0:2] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_auth_proto_init() }
|
||||
func file_auth_proto_init() {
|
||||
if File_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeliverTokenReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyTokenReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeliveryResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VerifyResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_auth_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_auth_proto_goTypes,
|
||||
DependencyIndexes: file_auth_proto_depIdxs,
|
||||
MessageInfos: file_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_auth_proto = out.File
|
||||
file_auth_proto_rawDesc = nil
|
||||
file_auth_proto_goTypes = nil
|
||||
file_auth_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
var _ context.Context
|
||||
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
type AuthService interface {
|
||||
DeliverTokenByRPC(ctx context.Context, req *DeliverTokenReq) (res *DeliveryResp, err error)
|
||||
VerifyTokenByRPC(ctx context.Context, req *VerifyTokenReq) (res *VerifyResp, err error)
|
||||
}
|
432
rpc_gen/kitex_gen/auth/authservice/authservice.go
Normal file
432
rpc_gen/kitex_gen/auth/authservice/authservice.go
Normal file
@ -0,0 +1,432 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
client "github.com/cloudwego/kitex/client"
|
||||
kitex "github.com/cloudwego/kitex/pkg/serviceinfo"
|
||||
streaming "github.com/cloudwego/kitex/pkg/streaming"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var errInvalidMessageType = errors.New("invalid message type for service method handler")
|
||||
|
||||
var serviceMethods = map[string]kitex.MethodInfo{
|
||||
"DeliverTokenByRPC": kitex.NewMethodInfo(
|
||||
deliverTokenByRPCHandler,
|
||||
newDeliverTokenByRPCArgs,
|
||||
newDeliverTokenByRPCResult,
|
||||
false,
|
||||
kitex.WithStreamingMode(kitex.StreamingUnary),
|
||||
),
|
||||
"VerifyTokenByRPC": kitex.NewMethodInfo(
|
||||
verifyTokenByRPCHandler,
|
||||
newVerifyTokenByRPCArgs,
|
||||
newVerifyTokenByRPCResult,
|
||||
false,
|
||||
kitex.WithStreamingMode(kitex.StreamingUnary),
|
||||
),
|
||||
}
|
||||
|
||||
var (
|
||||
authServiceServiceInfo = NewServiceInfo()
|
||||
authServiceServiceInfoForClient = NewServiceInfoForClient()
|
||||
authServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient()
|
||||
)
|
||||
|
||||
// for server
|
||||
func serviceInfo() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfo
|
||||
}
|
||||
|
||||
// for client
|
||||
func serviceInfoForStreamClient() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfoForStreamClient
|
||||
}
|
||||
|
||||
// for stream client
|
||||
func serviceInfoForClient() *kitex.ServiceInfo {
|
||||
return authServiceServiceInfoForClient
|
||||
}
|
||||
|
||||
// NewServiceInfo creates a new ServiceInfo containing all methods
|
||||
func NewServiceInfo() *kitex.ServiceInfo {
|
||||
return newServiceInfo(false, true, true)
|
||||
}
|
||||
|
||||
// NewServiceInfo creates a new ServiceInfo containing non-streaming methods
|
||||
func NewServiceInfoForClient() *kitex.ServiceInfo {
|
||||
return newServiceInfo(false, false, true)
|
||||
}
|
||||
func NewServiceInfoForStreamClient() *kitex.ServiceInfo {
|
||||
return newServiceInfo(true, true, false)
|
||||
}
|
||||
|
||||
func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo {
|
||||
serviceName := "AuthService"
|
||||
handlerType := (*auth.AuthService)(nil)
|
||||
methods := map[string]kitex.MethodInfo{}
|
||||
for name, m := range serviceMethods {
|
||||
if m.IsStreaming() && !keepStreamingMethods {
|
||||
continue
|
||||
}
|
||||
if !m.IsStreaming() && !keepNonStreamingMethods {
|
||||
continue
|
||||
}
|
||||
methods[name] = m
|
||||
}
|
||||
extra := map[string]interface{}{
|
||||
"PackageName": "auth",
|
||||
}
|
||||
if hasStreaming {
|
||||
extra["streaming"] = hasStreaming
|
||||
}
|
||||
svcInfo := &kitex.ServiceInfo{
|
||||
ServiceName: serviceName,
|
||||
HandlerType: handlerType,
|
||||
Methods: methods,
|
||||
PayloadCodec: kitex.Protobuf,
|
||||
KiteXGenVersion: "v0.9.1",
|
||||
Extra: extra,
|
||||
}
|
||||
return svcInfo
|
||||
}
|
||||
|
||||
func deliverTokenByRPCHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
|
||||
switch s := arg.(type) {
|
||||
case *streaming.Args:
|
||||
st := s.Stream
|
||||
req := new(auth.DeliverTokenReq)
|
||||
if err := st.RecvMsg(req); err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := handler.(auth.AuthService).DeliverTokenByRPC(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return st.SendMsg(resp)
|
||||
case *DeliverTokenByRPCArgs:
|
||||
success, err := handler.(auth.AuthService).DeliverTokenByRPC(ctx, s.Req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
realResult := result.(*DeliverTokenByRPCResult)
|
||||
realResult.Success = success
|
||||
return nil
|
||||
default:
|
||||
return errInvalidMessageType
|
||||
}
|
||||
}
|
||||
func newDeliverTokenByRPCArgs() interface{} {
|
||||
return &DeliverTokenByRPCArgs{}
|
||||
}
|
||||
|
||||
func newDeliverTokenByRPCResult() interface{} {
|
||||
return &DeliverTokenByRPCResult{}
|
||||
}
|
||||
|
||||
type DeliverTokenByRPCArgs struct {
|
||||
Req *auth.DeliverTokenReq
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetReq() {
|
||||
p.Req = new(auth.DeliverTokenReq)
|
||||
}
|
||||
return p.Req.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Size() (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.Size()
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetReq() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Req)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) Unmarshal(in []byte) error {
|
||||
msg := new(auth.DeliverTokenReq)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Req = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
var DeliverTokenByRPCArgs_Req_DEFAULT *auth.DeliverTokenReq
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) GetReq() *auth.DeliverTokenReq {
|
||||
if !p.IsSetReq() {
|
||||
return DeliverTokenByRPCArgs_Req_DEFAULT
|
||||
}
|
||||
return p.Req
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) IsSetReq() bool {
|
||||
return p.Req != nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCArgs) GetFirstArgument() interface{} {
|
||||
return p.Req
|
||||
}
|
||||
|
||||
type DeliverTokenByRPCResult struct {
|
||||
Success *auth.DeliveryResp
|
||||
}
|
||||
|
||||
var DeliverTokenByRPCResult_Success_DEFAULT *auth.DeliveryResp
|
||||
|
||||
func (p *DeliverTokenByRPCResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetSuccess() {
|
||||
p.Success = new(auth.DeliveryResp)
|
||||
}
|
||||
return p.Success.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Size() (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.Size()
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetSuccess() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Success)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) Unmarshal(in []byte) error {
|
||||
msg := new(auth.DeliveryResp)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Success = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) GetSuccess() *auth.DeliveryResp {
|
||||
if !p.IsSetSuccess() {
|
||||
return DeliverTokenByRPCResult_Success_DEFAULT
|
||||
}
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) SetSuccess(x interface{}) {
|
||||
p.Success = x.(*auth.DeliveryResp)
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) IsSetSuccess() bool {
|
||||
return p.Success != nil
|
||||
}
|
||||
|
||||
func (p *DeliverTokenByRPCResult) GetResult() interface{} {
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func verifyTokenByRPCHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
|
||||
switch s := arg.(type) {
|
||||
case *streaming.Args:
|
||||
st := s.Stream
|
||||
req := new(auth.VerifyTokenReq)
|
||||
if err := st.RecvMsg(req); err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := handler.(auth.AuthService).VerifyTokenByRPC(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return st.SendMsg(resp)
|
||||
case *VerifyTokenByRPCArgs:
|
||||
success, err := handler.(auth.AuthService).VerifyTokenByRPC(ctx, s.Req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
realResult := result.(*VerifyTokenByRPCResult)
|
||||
realResult.Success = success
|
||||
return nil
|
||||
default:
|
||||
return errInvalidMessageType
|
||||
}
|
||||
}
|
||||
func newVerifyTokenByRPCArgs() interface{} {
|
||||
return &VerifyTokenByRPCArgs{}
|
||||
}
|
||||
|
||||
func newVerifyTokenByRPCResult() interface{} {
|
||||
return &VerifyTokenByRPCResult{}
|
||||
}
|
||||
|
||||
type VerifyTokenByRPCArgs struct {
|
||||
Req *auth.VerifyTokenReq
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetReq() {
|
||||
p.Req = new(auth.VerifyTokenReq)
|
||||
}
|
||||
return p.Req.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Size() (n int) {
|
||||
if !p.IsSetReq() {
|
||||
return 0
|
||||
}
|
||||
return p.Req.Size()
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetReq() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Req)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) Unmarshal(in []byte) error {
|
||||
msg := new(auth.VerifyTokenReq)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Req = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
var VerifyTokenByRPCArgs_Req_DEFAULT *auth.VerifyTokenReq
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) GetReq() *auth.VerifyTokenReq {
|
||||
if !p.IsSetReq() {
|
||||
return VerifyTokenByRPCArgs_Req_DEFAULT
|
||||
}
|
||||
return p.Req
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) IsSetReq() bool {
|
||||
return p.Req != nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCArgs) GetFirstArgument() interface{} {
|
||||
return p.Req
|
||||
}
|
||||
|
||||
type VerifyTokenByRPCResult struct {
|
||||
Success *auth.VerifyResp
|
||||
}
|
||||
|
||||
var VerifyTokenByRPCResult_Success_DEFAULT *auth.VerifyResp
|
||||
|
||||
func (p *VerifyTokenByRPCResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
|
||||
if !p.IsSetSuccess() {
|
||||
p.Success = new(auth.VerifyResp)
|
||||
}
|
||||
return p.Success.FastRead(buf, _type, number)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) FastWrite(buf []byte) (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.FastWrite(buf)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Size() (n int) {
|
||||
if !p.IsSetSuccess() {
|
||||
return 0
|
||||
}
|
||||
return p.Success.Size()
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Marshal(out []byte) ([]byte, error) {
|
||||
if !p.IsSetSuccess() {
|
||||
return out, nil
|
||||
}
|
||||
return proto.Marshal(p.Success)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) Unmarshal(in []byte) error {
|
||||
msg := new(auth.VerifyResp)
|
||||
if err := proto.Unmarshal(in, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
p.Success = msg
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) GetSuccess() *auth.VerifyResp {
|
||||
if !p.IsSetSuccess() {
|
||||
return VerifyTokenByRPCResult_Success_DEFAULT
|
||||
}
|
||||
return p.Success
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) SetSuccess(x interface{}) {
|
||||
p.Success = x.(*auth.VerifyResp)
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) IsSetSuccess() bool {
|
||||
return p.Success != nil
|
||||
}
|
||||
|
||||
func (p *VerifyTokenByRPCResult) GetResult() interface{} {
|
||||
return p.Success
|
||||
}
|
||||
|
||||
type kClient struct {
|
||||
c client.Client
|
||||
}
|
||||
|
||||
func newServiceClient(c client.Client) *kClient {
|
||||
return &kClient{
|
||||
c: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *kClient) DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq) (r *auth.DeliveryResp, err error) {
|
||||
var _args DeliverTokenByRPCArgs
|
||||
_args.Req = Req
|
||||
var _result DeliverTokenByRPCResult
|
||||
if err = p.c.Call(ctx, "DeliverTokenByRPC", &_args, &_result); err != nil {
|
||||
return
|
||||
}
|
||||
return _result.GetSuccess(), nil
|
||||
}
|
||||
|
||||
func (p *kClient) VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq) (r *auth.VerifyResp, err error) {
|
||||
var _args VerifyTokenByRPCArgs
|
||||
_args.Req = Req
|
||||
var _result VerifyTokenByRPCResult
|
||||
if err = p.c.Call(ctx, "VerifyTokenByRPC", &_args, &_result); err != nil {
|
||||
return
|
||||
}
|
||||
return _result.GetSuccess(), nil
|
||||
}
|
55
rpc_gen/kitex_gen/auth/authservice/client.go
Normal file
55
rpc_gen/kitex_gen/auth/authservice/client.go
Normal file
@ -0,0 +1,55 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
client "github.com/cloudwego/kitex/client"
|
||||
callopt "github.com/cloudwego/kitex/client/callopt"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.
|
||||
type Client interface {
|
||||
DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error)
|
||||
VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error)
|
||||
}
|
||||
|
||||
// NewClient creates a client for the service defined in IDL.
|
||||
func NewClient(destService string, opts ...client.Option) (Client, error) {
|
||||
var options []client.Option
|
||||
options = append(options, client.WithDestService(destService))
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
kc, err := client.NewClient(serviceInfo(), options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &kAuthServiceClient{
|
||||
kClient: newServiceClient(kc),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs.
|
||||
func MustNewClient(destService string, opts ...client.Option) Client {
|
||||
kc, err := NewClient(destService, opts...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return kc
|
||||
}
|
||||
|
||||
type kAuthServiceClient struct {
|
||||
*kClient
|
||||
}
|
||||
|
||||
func (p *kAuthServiceClient) DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error) {
|
||||
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
|
||||
return p.kClient.DeliverTokenByRPC(ctx, Req)
|
||||
}
|
||||
|
||||
func (p *kAuthServiceClient) VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error) {
|
||||
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
|
||||
return p.kClient.VerifyTokenByRPC(ctx, Req)
|
||||
}
|
24
rpc_gen/kitex_gen/auth/authservice/invoker.go
Normal file
24
rpc_gen/kitex_gen/auth/authservice/invoker.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
|
||||
package authservice
|
||||
|
||||
import (
|
||||
server "github.com/cloudwego/kitex/server"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// NewInvoker creates a server.Invoker with the given handler and options.
|
||||
func NewInvoker(handler auth.AuthService, opts ...server.Option) server.Invoker {
|
||||
var options []server.Option
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
s := server.NewInvoker(options...)
|
||||
if err := s.RegisterService(serviceInfo(), handler); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := s.Init(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return s
|
||||
}
|
24
rpc_gen/kitex_gen/auth/authservice/server.go
Normal file
24
rpc_gen/kitex_gen/auth/authservice/server.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Code generated by Kitex v0.9.1. DO NOT EDIT.
|
||||
package authservice
|
||||
|
||||
import (
|
||||
server "github.com/cloudwego/kitex/server"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
)
|
||||
|
||||
// NewServer creates a server.Server with the given handler and options.
|
||||
func NewServer(handler auth.AuthService, opts ...server.Option) server.Server {
|
||||
var options []server.Option
|
||||
|
||||
options = append(options, opts...)
|
||||
|
||||
svr := server.NewServer(options...)
|
||||
if err := svr.RegisterService(serviceInfo(), handler); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return svr
|
||||
}
|
||||
|
||||
func RegisterService(svr server.Server, handler auth.AuthService, opts ...server.RegisterOption) error {
|
||||
return svr.RegisterService(serviceInfo(), handler, opts...)
|
||||
}
|
51
rpc_gen/rpc/auth/auth_client.go
Normal file
51
rpc_gen/rpc/auth/auth_client.go
Normal file
@ -0,0 +1,51 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
|
||||
"github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth/authservice"
|
||||
"github.com/cloudwego/kitex/client"
|
||||
"github.com/cloudwego/kitex/client/callopt"
|
||||
)
|
||||
|
||||
type RPCClient interface {
|
||||
KitexClient() authservice.Client
|
||||
Service() string
|
||||
DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error)
|
||||
VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error)
|
||||
}
|
||||
|
||||
func NewRPCClient(dstService string, opts ...client.Option) (RPCClient, error) {
|
||||
kitexClient, err := authservice.NewClient(dstService, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cli := &clientImpl{
|
||||
service: dstService,
|
||||
kitexClient: kitexClient,
|
||||
}
|
||||
|
||||
return cli, nil
|
||||
}
|
||||
|
||||
type clientImpl struct {
|
||||
service string
|
||||
kitexClient authservice.Client
|
||||
}
|
||||
|
||||
func (c *clientImpl) Service() string {
|
||||
return c.service
|
||||
}
|
||||
|
||||
func (c *clientImpl) KitexClient() authservice.Client {
|
||||
return c.kitexClient
|
||||
}
|
||||
|
||||
func (c *clientImpl) DeliverTokenByRPC(ctx context.Context, Req *auth.DeliverTokenReq, callOptions ...callopt.Option) (r *auth.DeliveryResp, err error) {
|
||||
return c.kitexClient.DeliverTokenByRPC(ctx, Req, callOptions...)
|
||||
}
|
||||
|
||||
func (c *clientImpl) VerifyTokenByRPC(ctx context.Context, Req *auth.VerifyTokenReq, callOptions ...callopt.Option) (r *auth.VerifyResp, err error) {
|
||||
return c.kitexClient.VerifyTokenByRPC(ctx, Req, callOptions...)
|
||||
}
|
26
rpc_gen/rpc/auth/auth_default.go
Normal file
26
rpc_gen/rpc/auth/auth_default.go
Normal file
@ -0,0 +1,26 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/auth"
|
||||
"github.com/cloudwego/kitex/client/callopt"
|
||||
"github.com/cloudwego/kitex/pkg/klog"
|
||||
)
|
||||
|
||||
func DeliverTokenByRPC(ctx context.Context, req *auth.DeliverTokenReq, callOptions ...callopt.Option) (resp *auth.DeliveryResp, err error) {
|
||||
resp, err = defaultClient.DeliverTokenByRPC(ctx, req, callOptions...)
|
||||
if err != nil {
|
||||
klog.CtxErrorf(ctx, "DeliverTokenByRPC call failed,err =%+v", err)
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func VerifyTokenByRPC(ctx context.Context, req *auth.VerifyTokenReq, callOptions ...callopt.Option) (resp *auth.VerifyResp, err error) {
|
||||
resp, err = defaultClient.VerifyTokenByRPC(ctx, req, callOptions...)
|
||||
if err != nil {
|
||||
klog.CtxErrorf(ctx, "VerifyTokenByRPC call failed,err =%+v", err)
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
40
rpc_gen/rpc/auth/auth_init.go
Normal file
40
rpc_gen/rpc/auth/auth_init.go
Normal file
@ -0,0 +1,40 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/cloudwego/kitex/client"
|
||||
)
|
||||
|
||||
var (
|
||||
// todo edit custom config
|
||||
defaultClient RPCClient
|
||||
defaultDstService = "auth"
|
||||
defaultClientOpts = []client.Option{
|
||||
client.WithHostPorts("127.0.0.1:8888"),
|
||||
}
|
||||
once sync.Once
|
||||
)
|
||||
|
||||
func init() {
|
||||
DefaultClient()
|
||||
}
|
||||
|
||||
func DefaultClient() RPCClient {
|
||||
once.Do(func() {
|
||||
defaultClient = newClient(defaultDstService, defaultClientOpts...)
|
||||
})
|
||||
return defaultClient
|
||||
}
|
||||
|
||||
func newClient(dstService string, opts ...client.Option) RPCClient {
|
||||
c, err := NewRPCClient(dstService, opts...)
|
||||
if err != nil {
|
||||
panic("failed to init client: " + err.Error())
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func InitClient(dstService string, opts ...client.Option) {
|
||||
defaultClient = newClient(dstService, opts...)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user