github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/client/allocdir/input/test.go (about)

     1  package test
     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  }