(peers []string)
| 25 | } |
| 26 | |
| 27 | func NewCacheServer(peers []string) *CacheServer { |
| 28 | cs := &CacheServer{ |
| 29 | cache: NewCache(10), |
| 30 | peers: peers, |
| 31 | hashRing: NewHashRing(), |
| 32 | } |
| 33 | for _, peer := range peers { |
| 34 | cs.hashRing.AddNode(Node{ID: peer, Addr: peer}) |
| 35 | } |
| 36 | |
| 37 | return cs |
| 38 | } |
| 39 | |
| 40 | func (cs *CacheServer) SetHandler(w http.ResponseWriter, r *http.Request) { |
| 41 | var req struct { |
nothing calls this directly
no test coverage detected