Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidContext = errors.New("missing or invalid context")
)
Functions ¶
func SaveInstance
deprecated
SaveInstance data into the cloudery matching the instance context.
Deprecated: Use ClouderyService.SaveInstance instead.
Types ¶
type BlockingSubscription ¶
type BlockingSubscription struct {
Vendor string `json:"vendor,omitempty"`
}
type ClouderyService ¶
type ClouderyService struct {
// contains filtered or unexported fields
}
ClouderyService handle all the Cloudery actions.
func NewService ¶
func NewService(contexts map[string]config.ClouderyConfig) *ClouderyService
NewService instantiate a new ClouderyService.
If contexts arg is nil, nil will be returned.
func (*ClouderyService) BlockingSubscription ¶
func (s *ClouderyService) BlockingSubscription(inst *instance.Instance) (*BlockingSubscription, error)
func (*ClouderyService) SaveInstance ¶
func (s *ClouderyService) SaveInstance(inst *instance.Instance, cmd *SaveCmd) error
SaveInstance data into the cloudery matching the instance context.
type Mock ¶
Mock impelementation of Service.
func (*Mock) BlockingSubscription ¶
func (m *Mock) BlockingSubscription(inst *instance.Instance) (*BlockingSubscription, error)
type NoopService ¶
type NoopService struct{}
NoopService implements Service.
This implem does nothing. It is used when no config is provided.
func (*NoopService) BlockingSubscription ¶
func (s *NoopService) BlockingSubscription(inst *instance.Instance) (*BlockingSubscription, error)
func (*NoopService) SaveInstance ¶
func (s *NoopService) SaveInstance(inst *instance.Instance, cmd *SaveCmd) error
SaveInstance does nothing.
type Service ¶
type Service interface { SaveInstance(inst *instance.Instance, cmd *SaveCmd) error BlockingSubscription(inst *instance.Instance) (*BlockingSubscription, error) }
Service handle all the interactions with the cloudery
Several implementations exists: - ClouderyService interacts via HTTP - NoopService when no config is setup - Mock for the tests
Click to show internal directories.
Click to hide internal directories.