cache

package
v0.0.0-...-c272109 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor interface {
	Get(id string) (ImmutableRef, error)
	New(s ImmutableRef) (MutableRef, error)
	GetMutable(id string) (MutableRef, error) // Rebase?
}

type Controller

type Controller interface {
	DiskUsage(ctx context.Context) ([]*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() error
	Size(ctx context.Context) (int64, error)
}

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
	Root        string
	GCPolicy    GCPolicy
}

type Mountable

type Mountable interface {
	Mount() ([]mount.Mount, error)
}

type MutableRef

type MutableRef interface {
	Mountable
	ID() string
	Freeze() (ImmutableRef, error)
	ReleaseAndCommit(ctx context.Context) (ImmutableRef, error)
	Size(ctx context.Context) (int64, error)
}

Jump to

Keyboard shortcuts

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