github.com/bigcommerce/nomad@v0.9.3-bc/client/interfaces/client.go (about) 1 package interfaces 2 3 import ( 4 "github.com/hashicorp/nomad/nomad/structs" 5 "github.com/hashicorp/nomad/plugins/device" 6 ) 7 8 type Client interface { 9 AllocStateHandler 10 } 11 12 // AllocStateHandler exposes a handler to be called when a allocation's state changes 13 type AllocStateHandler interface { 14 // AllocStateUpdated is used to emit an updated allocation. This allocation 15 // is stripped to only include client settable fields. 16 AllocStateUpdated(alloc *structs.Allocation) 17 } 18 19 // DeviceStatsReporter gives access to the latest resource usage 20 // for devices 21 type DeviceStatsReporter interface { 22 LatestDeviceResourceStats([]*structs.AllocatedDeviceResource) []*device.DeviceGroupStats 23 }