Documentation ¶
Index ¶
- type Service
- func (s *Service) Controller(ctx context.Context, controllerUUID string) (*crossmodel.ControllerInfo, error)
- func (s *Service) ControllerForModel(ctx context.Context, modelUUID string) (*crossmodel.ControllerInfo, error)
- func (s *Service) ControllersForModels(ctx context.Context, modelUUIDs ...string) ([]crossmodel.ControllerInfo, error)
- func (s *Service) ImportExternalControllers(ctx context.Context, externalControllers []crossmodel.ControllerInfo) error
- func (s *Service) ModelsForController(ctx context.Context, controllerUUID string) ([]string, error)
- func (s *Service) UpdateExternalController(ctx context.Context, ec crossmodel.ControllerInfo) 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 provides the API for working with external controllers.
func NewService ¶
NewService returns a new service reference wrapping the input state.
func (*Service) Controller ¶
func (s *Service) Controller( ctx context.Context, controllerUUID string, ) (*crossmodel.ControllerInfo, error)
Controller returns the controller record.
func (*Service) ControllerForModel ¶
func (s *Service) ControllerForModel( ctx context.Context, modelUUID string, ) (*crossmodel.ControllerInfo, error)
ControllerForModel returns the controller record that's associated with the modelUUID.
func (*Service) ControllersForModels ¶
func (s *Service) ControllersForModels( ctx context.Context, modelUUIDs ...string, ) ([]crossmodel.ControllerInfo, error)
ControllersForModels returns the list of controllers which are part of the given modelUUIDs. The resulting MigrationControllerInfo contains the list of models for each controller.
func (*Service) ImportExternalControllers ¶
func (s *Service) ImportExternalControllers( ctx context.Context, externalControllers []crossmodel.ControllerInfo, ) error
ImportExternalControllers imports the list of MigrationControllerInfo external controllers on one single transaction.
func (*Service) ModelsForController ¶
func (s *Service) ModelsForController( ctx context.Context, controllerUUID string, ) ([]string, error)
ModelsForController returns the list of model UUIDs for the given controllerUUID.
func (*Service) UpdateExternalController ¶
func (s *Service) UpdateExternalController( ctx context.Context, ec crossmodel.ControllerInfo, ) error
UpdateExternalController persists the input controller record and associates it with the input model UUIDs.
type State ¶
type State interface { // Controller returns the controller record. Controller(ctx context.Context, controllerUUID string) (*crossmodel.ControllerInfo, error) // UpdateExternalController persists the input controller // record. UpdateExternalController(ctx context.Context, ec crossmodel.ControllerInfo) error // ModelsForController returns the list of model UUIDs for // the given controllerUUID. ModelsForController(ctx context.Context, controllerUUID string) ([]string, error) // ImportExternalControllers imports the list of MigrationControllerInfo // external controllers on one single transaction. ImportExternalControllers(ctx context.Context, infos []crossmodel.ControllerInfo) error // ControllersForModels returns the list of controllers which // are part of the given modelUUIDs. // The resulting MigrationControllerInfo contains the list of models // for each controller. ControllersForModels(ctx context.Context, modelUUIDs ...string) ([]crossmodel.ControllerInfo, error) }
State describes retrieval and persistence methods for storage.
type WatchableService ¶
type WatchableService struct { Service // contains filtered or unexported fields }
WatchableService provides the API for working with external controllers and the ability to create watchers.
func NewWatchableService ¶
func NewWatchableService(st State, watcherFactory WatcherFactory) *WatchableService
NewWatchableService returns a new service reference wrapping the input state.
func (*WatchableService) Watch ¶
func (s *WatchableService) Watch() (watcher.StringsWatcher, error)
Watch returns a watcher that observes changes to external controllers.
type WatcherFactory ¶
type WatcherFactory interface { // NewUUIDsWatcher returns a watcher that emits the UUIDs for // changes to the input table name that match the input mask. NewUUIDsWatcher(string, changestream.ChangeType) (watcher.StringsWatcher, error) }
WatcherFactory describes methods for creating watchers.