Documentation ¶
Index ¶
- Variables
- type MessageSender
- type SetupParams
- type StateChangedInfo
- type Storage
- type StorageState
- func (storageState *StorageState) Cleanup(instanceIdent aostypes.InstanceIdent) error
- func (storageState *StorageState) Close()
- func (storageState *StorageState) GetInstanceCheckSum(instanceIdent aostypes.InstanceIdent) string
- func (storageState *StorageState) RemoveServiceInstance(instanceIdent aostypes.InstanceIdent) error
- func (storageState *StorageState) Setup(params SetupParams) (storagePath string, statePath string, err error)
- func (storageState *StorageState) StateAcceptance(updateState cloudprotocol.StateAcceptance) error
- func (storageState *StorageState) UpdateState(updateState cloudprotocol.UpdateState) error
- type StorageStateInstanceInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SetUserFSQuota = fs.SetUserFSQuota StateChangeTimeout = 1 * time.Second )
These global variables are used to be able to mocking the functionality in tests.
View Source
var ( ErrNotExist = errors.New("entry does not exist") ErrNotFound = errors.New("instance not found") )
ErrNotExist is returned when requested entry not exist in DB.
Functions ¶
This section is empty.
Types ¶
type MessageSender ¶
type MessageSender interface { SendInstanceNewState(newState cloudprotocol.NewState) error SendInstanceStateRequest(request cloudprotocol.StateRequest) error }
MessageSender sends messages to the cloud.
type SetupParams ¶
type SetupParams struct { aostypes.InstanceIdent UID int GID int StateQuota uint64 StorageQuota uint64 }
SetupParams setup storage state instance params.
type StateChangedInfo ¶
type StateChangedInfo struct { aostypes.InstanceIdent Checksum []byte }
StateChangedInfo contains state changed information.
type Storage ¶
type Storage interface { GetAllStorageStateInfo() ([]StorageStateInstanceInfo, error) GetStorageStateInfo(instanceIdent aostypes.InstanceIdent) (StorageStateInstanceInfo, error) SetStorageStateQuotas(instanceIdent aostypes.InstanceIdent, storageQuota, stateQuota uint64) error AddStorageStateInfo(storageStateInfo StorageStateInstanceInfo) error SetStateChecksum(instanceIdent aostypes.InstanceIdent, checksum []byte) error RemoveStorageStateInfo(instanceIdent aostypes.InstanceIdent) error }
Storage storage interface.
type StorageState ¶
StorageState storage state instance.
func New ¶
func New(cfg *config.Config, messageSender MessageSender, storage Storage) (storageState *StorageState, err error)
New creates storagestate instance.
func (*StorageState) Cleanup ¶
func (storageState *StorageState) Cleanup(instanceIdent aostypes.InstanceIdent) error
Cleanup cleans storagestate instance.
func (*StorageState) Close ¶
func (storageState *StorageState) Close()
Close closes storagestate instance.
func (*StorageState) GetInstanceCheckSum ¶
func (storageState *StorageState) GetInstanceCheckSum(instanceIdent aostypes.InstanceIdent) string
func (*StorageState) RemoveServiceInstance ¶
func (storageState *StorageState) RemoveServiceInstance(instanceIdent aostypes.InstanceIdent) error
func (*StorageState) Setup ¶
func (storageState *StorageState) Setup( params SetupParams, ) (storagePath string, statePath string, err error)
Setup setups storagestate instance.
func (*StorageState) StateAcceptance ¶
func (storageState *StorageState) StateAcceptance(updateState cloudprotocol.StateAcceptance) error
StateAcceptance acceptance state.
func (*StorageState) UpdateState ¶
func (storageState *StorageState) UpdateState(updateState cloudprotocol.UpdateState) error
UpdateState updates state.
type StorageStateInstanceInfo ¶
type StorageStateInstanceInfo struct { aostypes.InstanceIdent InstanceID string StorageQuota uint64 StateQuota uint64 StateChecksum []byte }
StorageStateInstanceInfo storage state instance info.
Click to show internal directories.
Click to hide internal directories.