Documentation ¶
Index ¶
- Variables
- type CommitOptions
- type Dataset
- func (ds *Dataset) Commit(v types.Value, opts CommitOptions) (Dataset, error)
- func (ds *Dataset) CommitValue(v types.Value) (Dataset, error)
- func (ds *Dataset) Database() datas.Database
- func (ds *Dataset) Head() types.Struct
- func (ds *Dataset) HeadRef() types.Ref
- func (ds *Dataset) HeadValue() types.Value
- func (ds *Dataset) ID() string
- func (ds *Dataset) MaybeHead() (types.Struct, bool)
- func (ds *Dataset) MaybeHeadRef() (types.Ref, bool)
- func (ds *Dataset) MaybeHeadValue() (types.Value, bool)
- func (ds *Dataset) Pull(sourceStore datas.Database, sourceRef types.Ref, concurrency int, ...) (Dataset, error)
Constants ¶
This section is empty.
Variables ¶
var DatasetRe = regexp.MustCompile(`[a-zA-Z0-9\-_/]+`)
Functions ¶
This section is empty.
Types ¶
type CommitOptions ¶
type CommitOptions struct { // Parents, if provided is the parent commits of the commit we are creating. Parents types.Set Meta types.Struct }
CommitOptions is used to pass options into Commit.
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
func (*Dataset) Commit ¶
Commit updates the commit that a dataset points at. The new Commit struct is constructed using `v`, `opts.Parents`, and `opts.Meta`. If `opts.Parents` is the zero value (`types.Set{}`) then the current head is used. If `opts.Meta is the zero value (`types.Struct{}`) then a fully initialized empty Struct is passed to NewCommit. If the update cannot be performed, e.g., because of a conflict, CommitWith returns an 'ErrMergeNeeded' error and the current snapshot of the dataset so that the client can merge the changes and try again.
func (*Dataset) CommitValue ¶
CommitValue updates the commit that a dataset points at. The new Commit struct is constructed using v and the current Head. If the update cannot be performed, e.g., because of a conflict, Commit returns an 'ErrMergeNeeded' error and the current snapshot of the dataset so that the client can merge the changes and try again.
func (*Dataset) Head ¶
Head returns the current head Commit, which contains the current root of the Dataset's value tree.
func (*Dataset) MaybeHead ¶
MaybeHead returns the current Head Commit of this Dataset, which contains the current root of the Dataset's value tree, if available. If not, it returns a new Commit and 'false'.
func (*Dataset) MaybeHeadValue ¶
MaybeHeadValue returns the Value field of the current head Commit, if avaliable. If not it returns nil and 'false'.