dsref

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Overview

Package dsref defines structure and syntax for referring to a dataset

Index

Constants

View Source
const AllGenerations = -1

AllGenerations represents all the generations of a dataset's history

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Refer
	Ref Ref `json:"ref,omitempty"`

	// FSIPath is this dataset's link to the local filesystem if one exists
	FSIPath string `json:"fsiPath,omitempty"`
	// Published indicates whether this reference is listed as an available dataset
	Published bool `json:"published"`
	// If true, this version doesn't exist locally
	Foreign bool `json:"foreign,omitempty"`

	// Creation timestamp
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Title field from dataset.commit component
	CommitTitle string `json:"commitTitle,omitempty"`
}

Info describes a version of a datsaet

type Ref

type Ref struct {
	// Username of dataset owner
	Username string `json:"username,omitempty"`
	// ProfileID of dataset owner
	ProfileID string `json:"profileID,omitempty"`
	// Unique name reference for this dataset
	Name string `json:"name,omitempty"`
	// Content-addressed path for this dataset
	Path string `json:"path,omitempty"`
}

Ref is a reference to a dataset

func (Ref) Alias

func (r Ref) Alias() (s string)

Alias returns the alias components of a Ref as a string

func (Ref) String

func (r Ref) String() (s string)

String implements the Stringer interface for Ref

type Rev

type Rev struct {
	// field scopt, currently can only be a component name, or the entire dataset
	Field string
	// the nth-generational ancestor of a history
	Gen int
}

Rev names a field of a dataset at a snapshot relative to the latest version in a history Much of this is inspired by git revisions: https://git-scm.com/docs/gitrevisions

Unlike git, Qri is aware of the underlying data model it's selecting against, so revisions can have conventional names for specifying fields of a dataset

func NewAllRevisions

func NewAllRevisions() Rev

NewAllRevisions returns a Rev struct that represents all revisions.

func ParseRev

func ParseRev(rev string) (*Rev, error)

ParseRev turns a string into a revision

func ParseRevs

func ParseRevs(str string) (revs []*Rev, err error)

ParseRevs turns a comma-separated list of revisions into a slice of revisions

Jump to

Keyboard shortcuts

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