allocator.go 244 Bytes
Newer Older
songlinfeng's avatar
songlinfeng committed
1
2
3
4
5
6
7
8
9
10
11
12
package allocator

type Allocator struct {
	available []*Device
	allocated []*Device
	policy    Policy
}

type Policy interface {
	Init(devs []*Device, topoDir string) error
	Allocate(available, required []string, size int) ([]string, error)
}