Documentation ¶
Index ¶
- Constants
- Variables
- func Apply(ctx context.Context, b Branch, src StoreTriple, fn func(*Snap) (*Snap, error)) error
- func CheckName(name string) error
- func CleanupVolume(ctx context.Context, vol Volume) error
- func ForEach(ctx context.Context, s Space, span Span, fn func(string) error) (retErr error)
- func History(ctx context.Context, b Branch, vcop *gotvc.Operator, ...) error
- func IsExists(err error) bool
- func IsNotExist(err error) bool
- func IsValidName(name string) bool
- func NewGotFS(b *Branch, opts ...gotfs.Option) *gotfs.Operator
- func NewGotVC(b *Branch, opts ...gotvc.Option) *gotvc.Operator
- func SetHead(ctx context.Context, b Branch, src StoreTriple, snap Snap) error
- func SortAnnotations(s []Annotation)
- func SyncVolumes(ctx context.Context, src, dst Volume, force bool) error
- func TestSpace(t *testing.T, newSpace func(t testing.TB) Space)
- type Annotation
- type Branch
- type CryptoSpace
- func (r *CryptoSpace) Create(ctx context.Context, name string, md Metadata) (*Branch, error)
- func (r *CryptoSpace) Delete(ctx context.Context, name string) error
- func (r *CryptoSpace) Get(ctx context.Context, name string) (*Branch, error)
- func (r *CryptoSpace) List(ctx context.Context, span Span, limit int) (ret []string, _ error)
- func (r *CryptoSpace) Set(ctx context.Context, name string, md Metadata) error
- type CryptoSpaceOption
- type Layer
- type MemSpace
- func (r *MemSpace) Create(ctx context.Context, name string, md Metadata) (*Branch, error)
- func (r *MemSpace) Delete(ctx context.Context, name string) error
- func (r *MemSpace) Get(ctx context.Context, name string) (*Branch, error)
- func (r *MemSpace) List(ctx context.Context, span Span, limit int) (ret []string, _ error)
- func (r *MemSpace) Set(ctx context.Context, name string, md Metadata) error
- type Metadata
- type Mode
- type PrefixSpace
- func (s PrefixSpace) Create(ctx context.Context, k string, md Metadata) (*Branch, error)
- func (s PrefixSpace) Delete(ctx context.Context, k string) error
- func (s PrefixSpace) Get(ctx context.Context, k string) (*Branch, error)
- func (s PrefixSpace) List(ctx context.Context, span Span, limit int) ([]string, error)
- func (s PrefixSpace) Set(ctx context.Context, k string, md Metadata) error
- type Snap
- type Space
- type Span
- type StoreTriple
- type Volume
Constants ¶
const ( ModeFrozen = iota ModeExpand ModeShrink )
const SecretSize = 32
Variables ¶
var ( ErrNotExist = errors.New("branch does not exist") ErrExists = errors.New("a branch already exists by that name") )
Functions ¶
func CleanupVolume ¶
Cleanup ensures that there are no unreachable blobs in volume.
func ForEach ¶ added in v0.0.3
ForEach is a convenience function which uses Space.List to call fn with all the branch names contained in span.
func IsNotExist ¶
func IsValidName ¶
func NewGotFS ¶ added in v0.0.4
NewGotFS creates a new gotfs.Operator suitable for writing to the branch
func NewGotVC ¶ added in v0.0.4
NewGotVC creates a new gotvc.Operator suitable for writing to the branch
func SortAnnotations ¶ added in v0.0.3
func SortAnnotations(s []Annotation)
func SyncVolumes ¶
SyncVolumes syncs the contents of src to dst.
Types ¶
type Annotation ¶ added in v0.0.3
Annotation annotates a branch
func GetAnnotation ¶ added in v0.0.3
func GetAnnotation(as []Annotation, key string) (ret []Annotation)
func (*Annotation) MarshalJSON ¶ added in v0.0.3
func (a *Annotation) MarshalJSON() ([]byte, error)
func (*Annotation) UnmarshalJSON ¶ added in v0.0.3
func (a *Annotation) UnmarshalJSON(data []byte) error
type CryptoSpace ¶
type CryptoSpace struct {
// contains filtered or unexported fields
}
type CryptoSpaceOption ¶ added in v0.0.3
type CryptoSpaceOption = func(*CryptoSpace)
CryptoSpaceOptions configure a CryptoSpace
func WithDecryptFailureHandler ¶ added in v0.0.3
func WithDecryptFailureHandler(fn func(string, error)) CryptoSpaceOption
WithDecryptFailureHandler sets fn to be called by the space when there is a decryption failure.
type MemSpace ¶
type MemSpace struct {
// contains filtered or unexported fields
}
type Metadata ¶ added in v0.0.3
type Metadata struct { Mode Mode `json:"mode"` Salt []byte `json:"salt"` Annotations []Annotation `json:"annotations"` }
Metadata is non-volume, user-modifiable information associated with a branch.
func NewMetadata ¶ added in v0.0.3
type Mode ¶ added in v0.0.3
type Mode uint8
func (Mode) MarshalText ¶ added in v0.0.3
func (*Mode) UnmarshalText ¶ added in v0.0.3
type PrefixSpace ¶ added in v0.0.3
PrefixSpace is a Space mapped into a prefix under the Target
func NewPrefixSpace ¶ added in v0.0.3
func NewPrefixSpace(inner Space, prefix string) PrefixSpace
func (PrefixSpace) Delete ¶ added in v0.0.3
func (s PrefixSpace) Delete(ctx context.Context, k string) error
type Space ¶
type Space interface { Create(ctx context.Context, name string, md Metadata) (*Branch, error) Get(ctx context.Context, name string) (*Branch, error) Set(ctx context.Context, name string, md Metadata) error Delete(ctx context.Context, name string) error List(ctx context.Context, span Span, limit int) ([]string, error) }
A Space holds named branches.
func NewCryptoSpace ¶
func NewCryptoSpace(inner Space, secret *[32]byte, opts ...CryptoSpaceOption) Space
func NewMultiSpace ¶
type StoreTriple ¶
StoreTriple is an instance of the 3 stores needed to store a Got Snapshot
type Volume ¶
Volume is a Cell and a set of stores
func (Volume) StoreTriple ¶
func (v Volume) StoreTriple() StoreTriple