Documentation ¶
Index ¶
- type Config
- type Instance
- func (s *Instance) FindOne(m func(i *internal.Instance) bool) (*internal.Instance, error)
- func (s *Instance) Get(id internal.InstanceID) (*internal.Instance, error)
- func (s *Instance) Insert(i *internal.Instance) error
- func (s *Instance) Remove(id internal.InstanceID) error
- func (s *Instance) UpdateState(iID internal.InstanceID, state internal.InstanceState) error
- type InstanceOperation
- func (s *InstanceOperation) Get(iID internal.InstanceID, opID internal.OperationID) (*internal.InstanceOperation, error)
- func (s *InstanceOperation) GetAll(iID internal.InstanceID) ([]*internal.InstanceOperation, error)
- func (s *InstanceOperation) Insert(io *internal.InstanceOperation) error
- func (s *InstanceOperation) Remove(iID internal.InstanceID, opID internal.OperationID) error
- func (s *InstanceOperation) UpdateState(iID internal.InstanceID, opID internal.OperationID, ...) error
- func (s *InstanceOperation) UpdateStateDesc(iID internal.InstanceID, opID internal.OperationID, ...) error
- func (s *InstanceOperation) WithTimeProvider(nowProvider func() time.Time) *InstanceOperation
- type RemoteEnvironment
- func (s *RemoteEnvironment) FindAll() ([]*internal.RemoteEnvironment, error)
- func (s *RemoteEnvironment) FindOneByServiceID(id internal.RemoteServiceID) (*internal.RemoteEnvironment, error)
- func (s *RemoteEnvironment) Get(name internal.RemoteEnvironmentName) (*internal.RemoteEnvironment, error)
- func (s *RemoteEnvironment) Remove(name internal.RemoteEnvironmentName) error
- func (s *RemoteEnvironment) Upsert(re *internal.RemoteEnvironment) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxKeys int64 `json:"max-keys"`
}
Config provide config for storage
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance implements in-memory storage for Instance entities.
func (*Instance) Remove ¶
func (s *Instance) Remove(id internal.InstanceID) error
Remove removing object from storage.
func (*Instance) UpdateState ¶
func (s *Instance) UpdateState(iID internal.InstanceID, state internal.InstanceState) error
UpdateState modifies state on object in storage.
type InstanceOperation ¶
type InstanceOperation struct {
// contains filtered or unexported fields
}
InstanceOperation implements in-memory storage InstanceOperation.
func NewInstanceOperation ¶
func NewInstanceOperation() *InstanceOperation
NewInstanceOperation returns new instance of InstanceOperation storage.
func (*InstanceOperation) Get ¶
func (s *InstanceOperation) Get(iID internal.InstanceID, opID internal.OperationID) (*internal.InstanceOperation, error)
Get returns object from storage.
func (*InstanceOperation) GetAll ¶
func (s *InstanceOperation) GetAll(iID internal.InstanceID) ([]*internal.InstanceOperation, error)
GetAll returns all objects from storage.
func (*InstanceOperation) Insert ¶
func (s *InstanceOperation) Insert(io *internal.InstanceOperation) error
Insert inserts object into storage.
func (*InstanceOperation) Remove ¶
func (s *InstanceOperation) Remove(iID internal.InstanceID, opID internal.OperationID) error
Remove removes object from storage.
func (*InstanceOperation) UpdateState ¶
func (s *InstanceOperation) UpdateState(iID internal.InstanceID, opID internal.OperationID, state internal.OperationState) error
UpdateState modifies state on object in storage.
func (*InstanceOperation) UpdateStateDesc ¶
func (s *InstanceOperation) UpdateStateDesc(iID internal.InstanceID, opID internal.OperationID, state internal.OperationState, desc *string) error
UpdateStateDesc updates both state and description for single operation. If desc is nil than description will be removed.
func (*InstanceOperation) WithTimeProvider ¶
func (s *InstanceOperation) WithTimeProvider(nowProvider func() time.Time) *InstanceOperation
WithTimeProvider allows for passing custom time provider. Used mostly in testing.
type RemoteEnvironment ¶
type RemoteEnvironment struct {
// contains filtered or unexported fields
}
RemoteEnvironment entity
func NewRemoteEnvironment ¶
func NewRemoteEnvironment() *RemoteEnvironment
NewRemoteEnvironment creates new storage for RemoteEnvironments
func (*RemoteEnvironment) FindAll ¶
func (s *RemoteEnvironment) FindAll() ([]*internal.RemoteEnvironment, error)
FindAll returns from memory all RemoteEnvironment
func (*RemoteEnvironment) FindOneByServiceID ¶
func (s *RemoteEnvironment) FindOneByServiceID(id internal.RemoteServiceID) (*internal.RemoteEnvironment, error)
FindOneByServiceID returns RemoteEnvironment which contains Service with given ID
func (*RemoteEnvironment) Get ¶
func (s *RemoteEnvironment) Get(name internal.RemoteEnvironmentName) (*internal.RemoteEnvironment, error)
Get returns from memory RemoteEnvironment with given name
func (*RemoteEnvironment) Remove ¶
func (s *RemoteEnvironment) Remove(name internal.RemoteEnvironmentName) error
Remove removes from memory RemoteEnvironment with given name
func (*RemoteEnvironment) Upsert ¶
func (s *RemoteEnvironment) Upsert(re *internal.RemoteEnvironment) (bool, error)
Upsert persists RemoteEnvironment in memory.
If RemoteEnvironment already exists in storage than full replace is performed.
True is returned if RemoteEnvironment already existed in storage and was replaced.