servicecontext.go 374 B

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