cache

package
v0.0.0-...-b35638e Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachePolicyRetain

func CachePolicyRetain(m withMetadata) error

func HasCachePolicyRetain

func HasCachePolicyRetain(m withMetadata) bool

func IsLocked

func IsLocked(err error) bool

Types

type Accessor

type Accessor interface {
	Get(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error)
	New(ctx context.Context, s ImmutableRef, opts ...RefOption) (MutableRef, error)
	GetMutable(ctx context.Context, id string) (MutableRef, error) // Rebase?
}

type Controller

type Controller interface {
	DiskUsage(ctx context.Context, info client.DiskUsageInfo) ([]*client.UsageInfo, error)
	Prune(ctx context.Context) (map[string]int64, error)
	GC(ctx context.Context) error
}

type GCPolicy

type GCPolicy struct {
	MaxSize         uint64
	MaxKeepDuration time.Duration
}

GCPolicy defines policy for garbage collection

type ImmutableRef

type ImmutableRef interface {
	Mountable
	ID() string
	Release(context.Context) error
	Size(ctx context.Context) (int64, error)
	Parent() ImmutableRef
	Finalize(ctx context.Context) error // Make sure reference is flushed to driver
	Metadata() *metadata.StorageItem
}

type Manager

type Manager interface {
	Accessor
	Controller
	Close() error
}

func NewManager

func NewManager(opt ManagerOpt) (Manager, error)

type ManagerOpt

type ManagerOpt struct {
	Snapshotter   snapshot.Snapshotter
	GCPolicy      GCPolicy
	MetadataStore *metadata.Store
}

type Mountable

type Mountable interface {
	Mount(ctx context.Context, readonly bool) ([]mount.Mount, error)
}

type MutableRef

type MutableRef interface {
	Mountable
	ID() string
	Commit(context.Context) (ImmutableRef, error)
	Release(context.Context) error
	Size(ctx context.Context) (int64, error)
	Metadata() *metadata.StorageItem
}

type RefOption

type RefOption func(withMetadata) error

func WithDescription

func WithDescription(descr string) RefOption

Directories

Path Synopsis
Package contenthash is a generated protocol buffer package.
Package contenthash is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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