scanner

package
v0.0.0-...-63c3a42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageDataBase

type ImageDataBase struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func LoadImageDataBase

func LoadImageDataBase(baseDir string, objSrv objectserver.FullObjectServer,
	replicationMaster string, logger log.DebugLogger) (*ImageDataBase, error)

func (*ImageDataBase) AddImage

func (imdb *ImageDataBase) AddImage(image *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(image *image.Image,
	doFunc func() error) error

func (*ImageDataBase) FindLatestImage

func (imdb *ImageDataBase) FindLatestImage(dirame string,
	ignoreExpiring bool) (string, error)

func (*ImageDataBase) GetImage

func (imdb *ImageDataBase) GetImage(name string) *image.Image

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) 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL