Documentation ¶
Index ¶
- Variables
- func Exists(view View, id ksuid.KSUID) bool
- func Play(w Writeable, o *Object) error
- func PlayAction(w Writeable, action Action) error
- type Action
- type Add
- type AddVector
- type Commit
- type DataObjects
- type Delete
- type DeleteVector
- type LogReader
- type Object
- func DecodeObject(r io.Reader) (*Object, error)
- func NewAddVectorsObject(parent ksuid.KSUID, author, message string, ids []ksuid.KSUID, retries int) *Object
- func NewAddsObject(parent ksuid.KSUID, retries int, author, message string, meta zed.Value, ...) *Object
- func NewDeleteVectorsObject(parent ksuid.KSUID, author, message string, ids []ksuid.KSUID, retries int) *Object
- func NewDeletesObject(parent ksuid.KSUID, retries int, author, message string, ids []ksuid.KSUID) *Object
- func NewObject(parent ksuid.KSUID, author, message string, meta zed.Value, retries int) *Object
- type Patch
- func (p *Patch) AddDataObject(object *data.Object) error
- func (p *Patch) AddVector(id ksuid.KSUID) error
- func (p *Patch) DataObjects() []ksuid.KSUID
- func (p *Patch) DeleteObject(id ksuid.KSUID) error
- func (p *Patch) DeleteVector(id ksuid.KSUID) error
- func (p *Patch) HasVector(id ksuid.KSUID) bool
- func (p *Patch) Lookup(id ksuid.KSUID) (*data.Object, error)
- func (p *Patch) NewCommitObject(parent ksuid.KSUID, retries int, author, message string, meta zed.Value) *Object
- func (p *Patch) Revert(tip *Snapshot, commit, parent ksuid.KSUID, retries int, author, message string) (*Object, error)
- func (p *Patch) Select(span extent.Span, o order.Which) DataObjects
- func (p *Patch) SelectAll() DataObjects
- type Snapshot
- func (s *Snapshot) AddDataObject(object *data.Object) error
- func (s *Snapshot) AddVector(id ksuid.KSUID) error
- func (s *Snapshot) Copy() *Snapshot
- func (s *Snapshot) DeleteObject(id ksuid.KSUID) error
- func (s *Snapshot) DeleteVector(id ksuid.KSUID) error
- func (s *Snapshot) Exists(id ksuid.KSUID) bool
- func (s *Snapshot) HasVector(id ksuid.KSUID) bool
- func (s *Snapshot) Lookup(id ksuid.KSUID) (*data.Object, error)
- func (s *Snapshot) Select(scan extent.Span, order order.Which) DataObjects
- func (s *Snapshot) SelectAll() DataObjects
- type Store
- func (s *Store) Get(ctx context.Context, commit ksuid.KSUID) (*Object, error)
- func (s *Store) GetBytes(ctx context.Context, commit ksuid.KSUID) ([]byte, *Commit, error)
- func (s *Store) Open(ctx context.Context, commit, stop ksuid.KSUID) (io.Reader, error)
- func (s *Store) OpenAsZNG(ctx context.Context, zctx *zed.Context, commit, stop ksuid.KSUID) (*zngio.Reader, error)
- func (s *Store) OpenCommitLog(ctx context.Context, zctx *zed.Context, commit, stop ksuid.KSUID) zio.Reader
- func (s *Store) PatchOfCommit(ctx context.Context, commit ksuid.KSUID) (*Patch, error)
- func (s *Store) PatchOfPath(ctx context.Context, base *Snapshot, baseID, commit ksuid.KSUID) (*Patch, error)
- func (s *Store) Path(ctx context.Context, leaf ksuid.KSUID) ([]ksuid.KSUID, error)
- func (s *Store) PathRange(ctx context.Context, from, to ksuid.KSUID) ([]ksuid.KSUID, error)
- func (s *Store) Put(ctx context.Context, o *Object) error
- func (s *Store) ReadAll(ctx context.Context, commit, stop ksuid.KSUID) ([]byte, error)
- func (s *Store) Remove(ctx context.Context, o *Object) error
- func (s *Store) Snapshot(ctx context.Context, leaf ksuid.KSUID) (*Snapshot, error)
- func (s *Store) Vacuumable(ctx context.Context, leaf ksuid.KSUID, out chan<- *data.Object) error
- type View
- type Writeable
Constants ¶
This section is empty.
Variables ¶
var ( ErrBadCommitObject = errors.New("first record of object not a commit") ErrExists = errors.New("commit object already exists") ErrNotFound = errors.New("commit object not found") )
var ActionTypes = []interface{}{ Add{}, AddVector{}, Delete{}, DeleteVector{}, Commit{}, }
var ErrEmptyTransaction = errors.New("empty transaction")
var ErrWriteConflict = errors.New("write conflict")
Functions ¶
func PlayAction ¶
Types ¶
type Commit ¶
type DataObjects ¶
func (*DataObjects) Append ¶
func (d *DataObjects) Append(objects DataObjects)
type DeleteVector ¶ added in v1.3.0
func (*DeleteVector) CommitID ¶ added in v1.3.0
func (d *DeleteVector) CommitID() ksuid.KSUID
func (*DeleteVector) String ¶ added in v1.3.0
func (d *DeleteVector) String() string
type Object ¶
type Object struct { Commit ksuid.KSUID `zed:"commit"` Parent ksuid.KSUID `zed:"parent"` Actions []Action `zed:"actions"` }
func NewAddVectorsObject ¶ added in v1.3.0
func NewAddsObject ¶
func NewDeleteVectorsObject ¶ added in v1.3.0
func NewDeletesObject ¶
type Patch ¶
type Patch struct {
// contains filtered or unexported fields
}
A Patch represents a difference between a base snapshot and the patched snapshot. Patch implements View so either a patch or a base snapshot can be traversed in the same manner. Furthermore, patches can be easily chained to implement a sequence of patches to a base snapshot.
func (*Patch) DataObjects ¶
func (*Patch) NewCommitObject ¶
func (*Patch) SelectAll ¶
func (p *Patch) SelectAll() DataObjects
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
A snapshot summarizes the pool state at any point in the commit object tree. XXX redefine snapshot as type map instead of struct
func NewSnapshot ¶
func NewSnapshot() *Snapshot
func (*Snapshot) DeleteVector ¶ added in v1.3.0
func (*Snapshot) SelectAll ¶
func (s *Snapshot) SelectAll() DataObjects
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) OpenCommitLog ¶
func (*Store) PatchOfCommit ¶
PatchOfCommit computes the snapshot at the parent of the indicated commit then computes the difference between that snapshot and the child commit, returning the difference as a patch.
func (*Store) PatchOfPath ¶
func (*Store) Path ¶
Path return the entire path from the commit object to the root in leaf to root order.