Documentation
¶
Index ¶
- type ProviderService
- type ProviderState
- type Service
- func (s *Service) Cloud(ctx context.Context, name string) (*cloud.Cloud, error)
- func (s *Service) CreateCloud(ctx context.Context, owner user.Name, cloud cloud.Cloud) error
- func (s *Service) DeleteCloud(ctx context.Context, name string) error
- func (s *Service) ListAll(ctx context.Context) ([]cloud.Cloud, error)
- func (s *Service) UpdateCloud(ctx context.Context, cloud cloud.Cloud) error
- type State
- type WatchableProviderService
- type WatchableService
- type WatcherFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderService ¶
type ProviderService struct {
// contains filtered or unexported fields
}
ProviderService provides the API for working with clouds. The provider service is a subset of the cloud service, and is used by the provider package to interact with the cloud service. By not exposing the full cloud service, the provider package is not able to modify the cloud entities, only read them.
func NewProviderService ¶
func NewProviderService(st ProviderState) *ProviderService
NewProviderService returns a new service reference wrapping the input state.
type ProviderState ¶
type ProviderState interface { // Cloud returns the cloud with the specified name. Cloud(context.Context, string) (*cloud.Cloud, error) // WatchCloud returns a new NotifyWatcher watching for changes to the specified cloud. WatchCloud( ctx context.Context, getWatcher func(string, string, changestream.ChangeType) (watcher.NotifyWatcher, error), name string, ) (watcher.NotifyWatcher, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides the API for working with clouds.
func (*Service) CreateCloud ¶
CreateCloud creates the input cloud entity and provides Admin permissions for the owner.
func (*Service) DeleteCloud ¶
DeleteCloud removes the specified cloud.
type State ¶
type State interface { ProviderState // CreateCloud creates the input cloud entity and provides Admin // permissions for the owner. CreateCloud(ctx context.Context, owner user.Name, cloudUUID string, cloud cloud.Cloud) error // UpdateCloud updates the input cloud entity. UpdateCloud(context.Context, cloud.Cloud) error // DeleteCloud deletes the input cloud entity. DeleteCloud(context.Context, string) error // ListClouds returns the clouds matching the optional filter. ListClouds(context.Context) ([]cloud.Cloud, error) }
State describes retrieval and persistence methods for storage.
type WatchableProviderService ¶
type WatchableProviderService struct { ProviderService // contains filtered or unexported fields }
WatchableProviderService returns a new provider service reference wrapping the input state and watcher factory.
func NewWatchableProviderService ¶
func NewWatchableProviderService(st ProviderState, watcherFactory WatcherFactory) *WatchableProviderService
NewWatchableProviderService returns a new service reference wrapping the input state and watcher factory.
func (*WatchableProviderService) WatchCloud ¶
func (s *WatchableProviderService) WatchCloud(ctx context.Context, name string) (watcher.NotifyWatcher, error)
WatchCloud returns a watcher that observes changes to the specified cloud.
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, watcherFactory WatcherFactory) *WatchableService
NewWatchableService returns a new service reference wrapping the input state and watcher factory.
func (*WatchableService) WatchCloud ¶
func (s *WatchableService) WatchCloud(ctx context.Context, name string) (watcher.NotifyWatcher, error)
WatchCloud returns a watcher that observes changes to the specified cloud.
type WatcherFactory ¶
type WatcherFactory interface { NewValueWatcher( namespace, uuid string, changeMask changestream.ChangeType, ) (watcher.NotifyWatcher, error) }
WatcherFactory instances return a watcher for a specified credential UUID,