Documentation ¶
Overview ¶
Package layermanager provides set of API to controls service fs layers
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotExist = errors.New("layer does not exist")
var NewSpaceAllocator = spaceallocator.New
NewSpaceAllocator space allocator constructor.
var RemoveCachedLayersPeriod = 24 * time.Hour
RemoveCachedLayersPeriod global variable is used to be able to mocking the layers TTL functionality in test.
Functions ¶
This section is empty.
Types ¶
type LayerInfo ¶
type LayerInfo struct { Digest string LayerID string Version string Path string OSVersion string Timestamp time.Time Cached bool Size uint64 }
LayerInfo layer information.
type LayerManager ¶
LayerManager instance.
func New ¶
func New(config *config.Config, layerStorage LayerStorage) (layermanager *LayerManager, err error)
*********************************************************************************************************************
- Public *********************************************************************************************************************
New creates new layer manager instance.
func (*LayerManager) Close ¶
func (layermanager *LayerManager) Close()
Close closes layer manager instance.
func (*LayerManager) GetLayerInfoByDigest ¶
func (layermanager *LayerManager) GetLayerInfoByDigest(digest string) (layer LayerInfo, err error)
GetLayerInfoByDigest gets layers information by layer digest.
func (*LayerManager) ProcessDesiredLayers ¶
func (layermanager *LayerManager) ProcessDesiredLayers(desiredLayers []aostypes.LayerInfo) error
ProcessDesiredLayers installs, removes, restores desired layers on the system.
type LayerStorage ¶
type LayerStorage interface { AddLayer(layer LayerInfo) error DeleteLayerByDigest(digest string) error GetLayersInfo() ([]LayerInfo, error) GetLayerInfoByDigest(digest string) (LayerInfo, error) SetLayerCached(digest string, cached bool) error }
LayerStorage provides API to add, remove or access layer information.
type SpaceAllocator ¶
type SpaceAllocator interface {
AllocateLayersSpace(extraSpace int64) (allocatedLayersSize int64, err error)
}
SpaceAllocator space allocator.