client.go 520 B

12345678910111213141516171819202122232425262728293031
  1. package extern
  2. import (
  3. "go-common/app/service/main/antispam/conf"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. type Client struct {
  7. *ReplyServiceClient
  8. }
  9. func NewClient(c *conf.Config) *Client {
  10. httpCli := bm.NewClient(c.HTTPClient)
  11. return &Client{
  12. ReplyServiceClient: &ReplyServiceClient{
  13. host: c.ReplyURL,
  14. commonClient: &commonClient{
  15. httpCli: httpCli,
  16. key: c.App.Key,
  17. secret: c.App.Secret,
  18. },
  19. },
  20. }
  21. }
  22. type commonClient struct {
  23. httpCli *bm.Client
  24. key, secret string
  25. }