api.go 471 B

12345678910111213141516171819202122232425
  1. package black
  2. import (
  3. "context"
  4. )
  5. const (
  6. _blackURL = "http://172.18.7.208/privatedata/reco-deny-arcs.json"
  7. )
  8. // Black returns blacklist of aids
  9. func (d *Dao) Black(c context.Context) (black map[int64]struct{}, err error) {
  10. var res []int64
  11. if err = d.clientAsyn.Get(c, _blackURL, "", nil, &res); err != nil {
  12. return
  13. }
  14. if len(res) == 0 {
  15. return
  16. }
  17. black = make(map[int64]struct{}, len(res))
  18. for _, aid := range res {
  19. black[aid] = struct{}{}
  20. }
  21. return
  22. }