Documentation ¶
Overview ¶
Package numpinalloc implements an ipfscluster.Allocator based on the "numpin" Informer. It is a simple example on how an allocator is implemented.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct{}
Allocator implements ipfscluster.Allocate.
func (*Allocator) Allocate ¶
func (alloc *Allocator) Allocate(c *cid.Cid, current, candidates map[peer.ID]api.Metric) ([]peer.ID, error)
Allocate returns where to allocate a pin request based on "numpin"-Informer metrics. In this simple case, we do not pay attention to the metrics of the current, we just need to sort the candidates by number of pins.
Click to show internal directories.
Click to hide internal directories.