volume

package
v0.0.0-...-9202c9a Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NameRegex = regexp.MustCompile(`^[a-zA-Z0-9-_]+$`)
	UnixEpoch = time.Unix(0, 0)

	ErrAlreadyCommitted = errors.New("already committed")
)

Functions

func CheckAndSetDefaults

func CheckAndSetDefaults(cfg *v1alpha1.Volume) error

Types

type Aborter

type Aborter interface {
	Abort() error
}

Aborter is the interface that wraps the basic Abort method.

Abort may return an error if the operation cannot be aborted.

type Committer

type Committer interface {
	Commit() error
}

Committer is the interface that wraps the basic Commit method.

Commit may return an error if the operation cannot be committed.

type ExecCtx

type ExecCtx interface {
	Logger() *zap.SugaredLogger
}

type File

type File interface {
	Name() string
	AcquireReader() (FileReader, error)
	AcquireWriter(inPlace bool) (FileWriter, error)
}

type FileReader

type FileReader interface {
	io.Reader
	io.Closer
	io.Seeker
	Size() int64
	WriteDone() <-chan struct{}
	ModTime() time.Time
}

type FileWriter

type FileWriter interface {
	io.Writer
	Committer
	Aborter
}

type Registry

type Registry interface {
	Get(name string) (Volume, bool)
}

type Volume

type Volume interface {
	Config() v1alpha1.Volume
	Init(execCtx ExecCtx) error
	Deinit(execCtx ExecCtx) error

	Open(path string) (File, error)
	OpenCreate(path string) (File, error)
	Delete(path string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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