dao.go 465 B

12345678910111213141516171819202122232425
  1. package global
  2. import (
  3. "go-common/app/admin/main/up/conf"
  4. accgrpc "go-common/app/service/main/account/api"
  5. "github.com/pkg/errors"
  6. )
  7. var (
  8. accCli accgrpc.AccountClient
  9. )
  10. // GetAccClient .
  11. func GetAccClient() accgrpc.AccountClient {
  12. return accCli
  13. }
  14. //Init init global
  15. func Init(c *conf.Config) {
  16. var err error
  17. if accCli, err = accgrpc.NewClient(c.GRPCClient.Account); err != nil {
  18. panic(errors.WithMessage(err, "Failed to dial account service"))
  19. }
  20. }