servicecontext.go 363 B

12345678910111213141516171819
  1. package svc
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. "ylink/core/auth/rpc/auth"
  5. "ylink/flowsrv/rpc/internal/config"
  6. )
  7. type ServiceContext struct {
  8. Config config.Config
  9. AuthRpc auth.Auth
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. return &ServiceContext{
  13. Config: c,
  14. AuthRpc: auth.NewAuth(zrpc.MustNewClient(c.AuthRpcConf)),
  15. }
  16. }