Documentation
¶
Index ¶
- type Service
- func (s *Service) AllBlockDevices(ctx context.Context) (map[string]blockdevice.BlockDevice, error)
- func (s *Service) BlockDevices(ctx context.Context, machineId string) ([]blockdevice.BlockDevice, error)
- func (s *Service) UpdateBlockDevices(ctx context.Context, machineId string, devices ...blockdevice.BlockDevice) error
- type State
- type WatchableService
- type WatcherFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines a service for interacting with the underlying state.
func NewService ¶
NewService returns a new Service for interacting with the underlying state.
func (*Service) AllBlockDevices ¶
func (s *Service) AllBlockDevices(ctx context.Context) (map[string]blockdevice.BlockDevice, error)
AllBlockDevices returns all block devices in the model, keyed on machine id.
func (*Service) BlockDevices ¶
func (s *Service) BlockDevices(ctx context.Context, machineId string) ([]blockdevice.BlockDevice, error)
BlockDevices returns the block devices for a specified machine.
func (*Service) UpdateBlockDevices ¶
func (s *Service) UpdateBlockDevices(ctx context.Context, machineId string, devices ...blockdevice.BlockDevice) error
UpdateBlockDevices updates the block devices for a specified machine.
type State ¶
type State interface { // BlockDevices returns the block devices for a specified machine. BlockDevices(ctx context.Context, machineId string) ([]blockdevice.BlockDevice, error) // SetMachineBlockDevices updates the block devices for a specified machine. SetMachineBlockDevices(ctx context.Context, machineId string, devices ...blockdevice.BlockDevice) error // MachineBlockDevices returns all block devices in the model, keyed on // machine id. MachineBlockDevices(ctx context.Context) ([]blockdevice.MachineBlockDevice, error) // WatchBlockDevices returns a new NotifyWatcher watching for // changes to block devices associated with the specified machine. WatchBlockDevices(ctx context.Context, getWatcher getWatcherFunc, machineId string) (watcher.NotifyWatcher, error) }
State defines an interface for interacting with the underlying state.
type WatchableService ¶
type WatchableService struct { Service // contains filtered or unexported fields }
WatchableService defines a service for interacting with the underlying state and the ability to create watchers.
func NewWatchableService ¶
func NewWatchableService(st State, wf WatcherFactory, logger logger.Logger) *WatchableService
NewWatchableService returns a new Service for interacting with the underlying state and the ability to create watchers.
func (*WatchableService) WatchBlockDevices ¶
func (s *WatchableService) WatchBlockDevices( ctx context.Context, machineId string, ) (watcher.NotifyWatcher, error)
WatchBlockDevices returns a new NotifyWatcher watching for changes to block devices associated with the specified machine.
type WatcherFactory ¶
type WatcherFactory interface { NewValueMapperWatcher( namespace, changeValue string, changeMask changestream.ChangeType, mapper eventsource.Mapper, ) (watcher.NotifyWatcher, error) }
WatcherFactory describes methods for creating watchers.