client.go 613 B

123456789101112131415161718192021222324252627282930313233343536
  1. package client
  2. import (
  3. "context"
  4. "go-common/app/service/main/identify-game/model"
  5. "go-common/library/net/rpc"
  6. )
  7. const (
  8. _delCache = "RPC.DelCache"
  9. _appid = "identify.service.game"
  10. )
  11. var (
  12. _noRes = &struct{}{}
  13. )
  14. // Client Request Client
  15. type Client struct {
  16. client *rpc.Client2
  17. }
  18. // New Request Client
  19. func New(c *rpc.ClientConfig) (cli *Client) {
  20. cli = &Client{
  21. client: rpc.NewDiscoveryCli(_appid, c),
  22. }
  23. return
  24. }
  25. // DelCache del token cache.
  26. func (cli *Client) DelCache(c context.Context, arg *model.CleanCacheArgs) (err error) {
  27. err = cli.client.Call(c, _delCache, arg, _noRes)
  28. return
  29. }