Documentation ¶
Index ¶
- Variables
- type ImageParts
- type ServiceInfo
- type ServiceManager
- func (sm *ServiceManager) Close()
- func (sm *ServiceManager) GetImageParts(service ServiceInfo) (parts ImageParts, err error)
- func (sm *ServiceManager) GetServiceInfo(serviceID string) (serviceInfo ServiceInfo, err error)
- func (sm *ServiceManager) ProcessDesiredServices(desiredServices []aostypes.ServiceInfo) error
- func (sm *ServiceManager) ValidateService(service ServiceInfo) error
- type ServiceStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExist not exist service error. ErrNotExist = errors.New("service not exist") // ErrVersionMismatch new service version <= existing one. ErrVersionMismatch = errors.New("version mismatch") )
View Source
var NewSpaceAllocator = spaceallocator.New
NewSpaceAllocator space allocator constructor.
View Source
var RemoveCachedServicesPeriod = 24 * time.Hour
RemoveCachedServicesPeriod global variable is used to be able to mocking the services TTL functionality in test.
Functions ¶
This section is empty.
Types ¶
type ImageParts ¶
type ImageParts struct { ImageConfigPath string ServiceConfigPath string ServiceFSPath string LayersDigest []string }
ImageParts struct with paths for image parts.
type ServiceInfo ¶
type ServiceInfo struct { aostypes.VersionInfo ServiceID string ServiceProvider string ImagePath string ManifestDigest []byte Timestamp time.Time Cached bool Size uint64 GID uint32 }
ServiceInfo service information.
type ServiceManager ¶
ServiceManager instance.
func New ¶
func New( config *config.Config, serviceInfoProvider ServiceStorage, ) (sm *ServiceManager, err error)
New creates new service manager object.
func (*ServiceManager) Close ¶
func (sm *ServiceManager) Close()
Close closes service manager instance.
func (*ServiceManager) GetImageParts ¶
func (sm *ServiceManager) GetImageParts(service ServiceInfo) (parts ImageParts, err error)
GetImageParts gets image parts for the service.
func (*ServiceManager) GetServiceInfo ¶
func (sm *ServiceManager) GetServiceInfo(serviceID string) (serviceInfo ServiceInfo, err error)
GetServiceInfo gets service information by id.
func (*ServiceManager) ProcessDesiredServices ¶
func (sm *ServiceManager) ProcessDesiredServices(desiredServices []aostypes.ServiceInfo) error
ProcessDesiredServices installs, removes, restores desired services on the system.
func (*ServiceManager) ValidateService ¶
func (sm *ServiceManager) ValidateService(service ServiceInfo) error
ValidateService validate service.
type ServiceStorage ¶
type ServiceStorage interface { GetAllServiceVersions(serviceID string) ([]ServiceInfo, error) GetServices() ([]ServiceInfo, error) AddService(info ServiceInfo) error RemoveService(serviceID string, aosVersion uint64) error SetServiceCached(serviceID string, aosVersion uint64, cached bool) error }
ServiceStorage provides API to create, remove or access services DB.
Click to show internal directories.
Click to hide internal directories.