Documentation ¶
Index ¶
- type Config
- type ImageDataBase
- func (imdb *ImageDataBase) AddImage(img *image.Image, name string, authInfo *srpc.AuthInformation) error
- func (imdb *ImageDataBase) ChangeImageExpiration(name string, expiresAt time.Time, authInfo *srpc.AuthInformation) (bool, error)
- func (imdb *ImageDataBase) CheckDirectory(name string) bool
- func (imdb *ImageDataBase) CheckImage(name string) bool
- func (imdb *ImageDataBase) ChownDirectory(dirname, ownerGroup string, authInfo *srpc.AuthInformation) error
- func (imdb *ImageDataBase) CountDirectories() uint
- func (imdb *ImageDataBase) CountImages() uint
- func (imdb *ImageDataBase) DeleteImage(name string, authInfo *srpc.AuthInformation) error
- func (imdb *ImageDataBase) DeleteUnreferencedObjects(percentage uint8, bytes uint64) error
- func (imdb *ImageDataBase) DoWithPendingImage(img *image.Image, doFunc func() error) error
- func (imdb *ImageDataBase) FindLatestImage(request proto.FindLatestImageRequest) (string, error)
- func (imdb *ImageDataBase) GetImage(name string) *image.Image
- func (imdb *ImageDataBase) GetUnreferencedObjectsStatistics() (uint64, uint64)
- func (imdb *ImageDataBase) ListDirectories() []image.Directory
- func (imdb *ImageDataBase) ListImages() []string
- func (imdb *ImageDataBase) ListSelectedImages(request proto.ListSelectedImagesRequest) []string
- func (imdb *ImageDataBase) ListUnreferencedObjects() map[hash.Hash]uint64
- func (imdb *ImageDataBase) MakeDirectory(dirname string, authInfo *srpc.AuthInformation) error
- func (imdb *ImageDataBase) ObjectServer() objectserver.ObjectServer
- func (imdb *ImageDataBase) RegisterAddNotifier() <-chan string
- func (imdb *ImageDataBase) RegisterDeleteNotifier() <-chan string
- func (imdb *ImageDataBase) RegisterMakeDirectoryNotifier() <-chan image.Directory
- func (imdb *ImageDataBase) UnregisterAddNotifier(channel <-chan string)
- func (imdb *ImageDataBase) UnregisterDeleteNotifier(channel <-chan string)
- func (imdb *ImageDataBase) UnregisterMakeDirectoryNotifier(channel <-chan image.Directory)
- func (imdb *ImageDataBase) UpdateDirectory(directory image.Directory) error
- func (imdb *ImageDataBase) WriteHtml(writer io.Writer)
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageDataBase ¶
func LoadImageDataBase ¶
func LoadImageDataBase(baseDir string, objSrv objectserver.FullObjectServer, replicationMaster string, logger log.DebugLogger) (*ImageDataBase, error)
func (*ImageDataBase) AddImage ¶
func (imdb *ImageDataBase) AddImage(img *image.Image, name string, authInfo *srpc.AuthInformation) error
func (*ImageDataBase) ChangeImageExpiration ¶
func (imdb *ImageDataBase) ChangeImageExpiration(name string, expiresAt time.Time, authInfo *srpc.AuthInformation) (bool, error)
func (*ImageDataBase) CheckDirectory ¶
func (imdb *ImageDataBase) CheckDirectory(name string) bool
func (*ImageDataBase) CheckImage ¶
func (imdb *ImageDataBase) CheckImage(name string) bool
func (*ImageDataBase) ChownDirectory ¶
func (imdb *ImageDataBase) ChownDirectory(dirname, ownerGroup string, authInfo *srpc.AuthInformation) error
func (*ImageDataBase) CountDirectories ¶
func (imdb *ImageDataBase) CountDirectories() uint
func (*ImageDataBase) CountImages ¶
func (imdb *ImageDataBase) CountImages() uint
func (*ImageDataBase) DeleteImage ¶
func (imdb *ImageDataBase) DeleteImage(name string, authInfo *srpc.AuthInformation) error
func (*ImageDataBase) DeleteUnreferencedObjects ¶
func (imdb *ImageDataBase) DeleteUnreferencedObjects(percentage uint8, bytes uint64) error
DeleteUnreferencedObjects will delete some or all unreferenced objects. Objects are randomly selected for deletion, until both the percentage and bytes thresholds are satisfied. If an image upload/replication is in process this operation is unsafe as it may delete objects that the new image will be using.
func (*ImageDataBase) DoWithPendingImage ¶
func (imdb *ImageDataBase) DoWithPendingImage(img *image.Image, doFunc func() error) error
func (*ImageDataBase) FindLatestImage ¶
func (imdb *ImageDataBase) FindLatestImage( request proto.FindLatestImageRequest) (string, error)
func (*ImageDataBase) GetUnreferencedObjectsStatistics ¶
func (imdb *ImageDataBase) GetUnreferencedObjectsStatistics() (uint64, uint64)
func (*ImageDataBase) ListDirectories ¶
func (imdb *ImageDataBase) ListDirectories() []image.Directory
func (*ImageDataBase) ListImages ¶
func (imdb *ImageDataBase) ListImages() []string
func (*ImageDataBase) ListSelectedImages ¶ added in v0.3.4
func (imdb *ImageDataBase) ListSelectedImages( request proto.ListSelectedImagesRequest) []string
func (*ImageDataBase) ListUnreferencedObjects ¶
func (imdb *ImageDataBase) ListUnreferencedObjects() map[hash.Hash]uint64
ListUnreferencedObjects will return a map listing all the objects and their corresponding sizes which are not referenced by an image. Note that some objects may have been recently added and the referencing image may not yet be present (i.e. it may be added after missing objects are uploaded).
func (*ImageDataBase) MakeDirectory ¶
func (imdb *ImageDataBase) MakeDirectory(dirname string, authInfo *srpc.AuthInformation) error
func (*ImageDataBase) ObjectServer ¶
func (imdb *ImageDataBase) ObjectServer() objectserver.ObjectServer
func (*ImageDataBase) RegisterAddNotifier ¶
func (imdb *ImageDataBase) RegisterAddNotifier() <-chan string
func (*ImageDataBase) RegisterDeleteNotifier ¶
func (imdb *ImageDataBase) RegisterDeleteNotifier() <-chan string
func (*ImageDataBase) RegisterMakeDirectoryNotifier ¶
func (imdb *ImageDataBase) RegisterMakeDirectoryNotifier() <-chan image.Directory
func (*ImageDataBase) UnregisterAddNotifier ¶
func (imdb *ImageDataBase) UnregisterAddNotifier(channel <-chan string)
func (*ImageDataBase) UnregisterDeleteNotifier ¶
func (imdb *ImageDataBase) UnregisterDeleteNotifier(channel <-chan string)
func (*ImageDataBase) UnregisterMakeDirectoryNotifier ¶
func (imdb *ImageDataBase) UnregisterMakeDirectoryNotifier( channel <-chan image.Directory)
func (*ImageDataBase) UpdateDirectory ¶
func (imdb *ImageDataBase) UpdateDirectory(directory image.Directory) error
func (*ImageDataBase) WriteHtml ¶
func (imdb *ImageDataBase) WriteHtml(writer io.Writer)
type Params ¶ added in v0.3.4
type Params struct { Logger log.DebugLogger ObjectServer objectserver.FullObjectServer }
Click to show internal directories.
Click to hide internal directories.