objectserver

package
v0.0.0-...-d8f7d12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyObject

func CopyObject(filename string, objectsGetter ObjectsGetter,
	hashVal hash.Hash) error

func GetObject

func GetObject(objSrv ObjectsGetter, hashVal hash.Hash) (
	uint64, io.ReadCloser, error)

func LinkObject

func LinkObject(filename string, objectsGetter ObjectsGetter,
	hashVal hash.Hash) (bool, error)

Types

type AddCallback

type AddCallback func(hashVal hash.Hash, length uint64, isNew bool)

type AddCallbackSetter

type AddCallbackSetter interface {
	SetAddCallback(callback AddCallback)
}

type FullObjectServer

type FullObjectServer interface {
	DeleteObject(hashVal hash.Hash) error
	ObjectServer
	LastMutationTime() time.Time
	ListObjectSizes() map[hash.Hash]uint64
	ListObjects() []hash.Hash
	NumObjects() uint64
}

type FullObjectsReader

type FullObjectsReader interface {
	ObjectsReader
	ObjectSizes() []uint64
}

type GarbageCollector

type GarbageCollector func(bytesToDelete uint64) (
	bytesDeleted uint64, err error)

type GarbageCollectorSetter

type GarbageCollectorSetter interface {
	SetGarbageCollector(gc GarbageCollector)
}

type ObjectGetter

type ObjectGetter interface {
	GetObject(hashVal hash.Hash) (uint64, io.ReadCloser, error)
}

type ObjectLinker

type ObjectLinker interface {
	LinkObject(filename string, hashVal hash.Hash) (bool, error)
}

type ObjectServer

type ObjectServer interface {
	AddObject(reader io.Reader, length uint64, expectedHash *hash.Hash) (
		hash.Hash, bool, error)
	ObjectGetter
	ObjectsChecker
	ObjectsGetter
}

type ObjectsChecker

type ObjectsChecker interface {
	CheckObjects(hashes []hash.Hash) ([]uint64, error)
}

type ObjectsGetter

type ObjectsGetter interface {
	GetObjects(hashes []hash.Hash) (ObjectsReader, error)
}

type ObjectsReader

type ObjectsReader interface {
	Close() error
	NextObject() (uint64, io.ReadCloser, error)
}

type StashingObjectServer

type StashingObjectServer interface {
	CommitObject(hash.Hash) error
	DeleteStashedObject(hashVal hash.Hash) error
	ObjectServer
	StashOrVerifyObject(io.Reader, uint64, *hash.Hash) (
		hash.Hash, []byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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