Documentation ¶
Index ¶
- func ForEach(ctx context.Context, s cadata.Store, xs []Ref, fn func(Ref, Snapshot) error) error
- func IsDescendentOf(ctx context.Context, s Store, x, a Snapshot) (bool, error)
- func Populate(ctx context.Context, s cadata.Store, start Snapshot, set stores.Set, ...) error
- func Sync(ctx context.Context, src cadata.Store, dst cadata.Store, snap Snapshot, ...) error
- type Operator
- func (o *Operator) Check(ctx context.Context, s cadata.Store, snap Snapshot, ...) error
- func (op *Operator) GetSnapshot(ctx context.Context, s Store, ref Ref) (*Snapshot, error)
- func (o *Operator) NewSnapshot(ctx context.Context, s cadata.Store, parents []Snapshot, root Root, ...) (*Snapshot, error)
- func (op *Operator) NewZero(ctx context.Context, s cadata.Store, root Root, sinfo SnapInfo) (*Snapshot, error)
- func (op *Operator) PostSnapshot(ctx context.Context, s Store, x Snapshot) (*Ref, error)
- func (op *Operator) RefFromSnapshot(snap Snapshot, s cadata.Store) Ref
- func (op *Operator) Squash(ctx context.Context, s Store, x Snapshot, n int) (*Snapshot, error)
- type Option
- type Ref
- type Root
- type Snap
- type SnapInfo
- type Snapshot
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDescendentOf ¶
IsDescendentOf returns true if any of x's parents are equal to a.
Types ¶
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperator ¶
func (*Operator) Check ¶
func (o *Operator) Check(ctx context.Context, s cadata.Store, snap Snapshot, checkRoot func(gotfs.Root) error) error
Check ensures that snapshot is valid.
func (*Operator) GetSnapshot ¶
GetSnapshot retrieves the snapshot referenced by ref from the store.
func (*Operator) NewSnapshot ¶
func (*Operator) NewZero ¶
func (op *Operator) NewZero(ctx context.Context, s cadata.Store, root Root, sinfo SnapInfo) (*Snapshot, error)
NewZero creates a new snapshot with no parent
func (*Operator) PostSnapshot ¶
PostSnapshot marshals the snapshot and posts it to the store
func (*Operator) RefFromSnapshot ¶
RefFromSnapshot computes a ref for snap if it was posted to s. It only calls s.Hash and s.MaxSize; it does not mutate s.
type Snapshot ¶
type Snapshot struct { N uint64 `json:"n"` Root gotfs.Root `json:"root"` Parents []gdat.Ref `json:"parents"` CreatedAt tai64.TAI64 `json:"created_at"` Creator string `json:"creator,omitempty"` AuthoredAt tai64.TAI64 `json:"authored_at"` Authors []string `json:"authors,omitempty"` Message string `json:"message"` }
Click to show internal directories.
Click to hide internal directories.