dataset

package
v0.0.0-...-160d89c Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewDataset

func NewDataset(db datas.Database, datasetID string) Dataset

func (*Dataset) Commit

func (ds *Dataset) Commit(v types.Value, opts CommitOptions) (Dataset, error)

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

func (ds *Dataset) CommitValue(v types.Value) (Dataset, error)

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) Database

func (ds *Dataset) Database() datas.Database

func (*Dataset) Head

func (ds *Dataset) Head() types.Struct

Head returns the current head Commit, which contains the current root of the Dataset's value tree.

func (*Dataset) HeadRef

func (ds *Dataset) HeadRef() types.Ref

func (*Dataset) HeadValue

func (ds *Dataset) HeadValue() types.Value

HeadValue returns the Value field of the current head Commit.

func (*Dataset) ID

func (ds *Dataset) ID() string

func (*Dataset) MaybeHead

func (ds *Dataset) MaybeHead() (types.Struct, bool)

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) MaybeHeadRef

func (ds *Dataset) MaybeHeadRef() (types.Ref, bool)

func (*Dataset) MaybeHeadValue

func (ds *Dataset) MaybeHeadValue() (types.Value, bool)

MaybeHeadValue returns the Value field of the current head Commit, if avaliable. If not it returns nil and 'false'.

func (*Dataset) Pull

func (ds *Dataset) Pull(sourceStore datas.Database, sourceRef types.Ref, concurrency int, progressCh chan datas.PullProgress) (Dataset, error)

Jump to

Keyboard shortcuts

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