reporef

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToDsref

func ConvertToDsref(ref DatasetRef) dsref.Ref

ConvertToDsref is a shim function to transition from a reporef.DatasetRef to a dsref.Ref while we experiment with dsref as the home of name parsing

func ConvertToVersionInfo

func ConvertToVersionInfo(r *DatasetRef) dsref.VersionInfo

ConvertToVersionInfo converts an old style DatasetRef to the newly preferred dsref.VersionInfo

Types

type DatasetLogItem added in v0.9.7

type DatasetLogItem = logbook.DatasetLogItem

DatasetLogItem aliases the type from logbook

func ConvertToDatasetLogItem added in v0.9.7

func ConvertToDatasetLogItem(r *DatasetRef) DatasetLogItem

ConvertToDatasetLogItem converts an old style DatasetRef to the newly preferred DatasetLogItem

type DatasetRef deprecated

type DatasetRef struct {
	// Peername of dataset owner
	Peername string `json:"peername,omitempty"`
	// ProfileID of dataset owner
	ProfileID profile.ID `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"`
	// FSIPath is this dataset's link to the local filesystem if one exists
	FSIPath string `json:"fsiPath,omitempty"`
	// Dataset is a pointer to the dataset being referenced
	Dataset *dataset.Dataset `json:"dataset,omitempty"`
	// Published indicates whether this reference is listed as an available dataset
	Published bool `json:"published"`
	// If true, this reference doesn't exist locally. Only makes sense if path is set, as this
	// flag refers to specific versions, not to entire dataset histories.
	Foreign bool `json:"foreign,omitempty"`
}

DatasetRef encapsulates a reference to a dataset. This needs to exist to bind ways of referring to a dataset to a dataset itself, as datasets can't easily contain their own hash information, and names are unique on a per-repository basis.

Deprecated: DatasetRef will be removed in future versions of Qri, use dsref.Ref and this package's Info struct instead

func RefFromDsref added in v0.9.7

func RefFromDsref(r dsref.Ref) DatasetRef

RefFromDsref creates a datasetRef from a dsref.Ref. The profileID field will be an empty string if the input profileID is blank or otherwise cannot be decoded.

func (DatasetRef) Absolute

func (r DatasetRef) Absolute() (s string)

Absolute implements the same thing as String(), but append ProfileID if it exist

func (DatasetRef) AliasString

func (r DatasetRef) AliasString() (s string)

AliasString returns the alias components of a DatasetRef as a string

func (DatasetRef) Complete

func (r DatasetRef) Complete() bool

Complete returns true if a dataset has Peername, Name, ProfileID and Path properties set

func (DatasetRef) DebugString

func (r DatasetRef) DebugString() string

DebugString returns a string that describes every field in the reference, useful for tests

func (DatasetRef) Equal

func (r DatasetRef) Equal(b DatasetRef) bool

Equal returns true only if Peername Name and Path are equal

func (DatasetRef) IsEmpty

func (r DatasetRef) IsEmpty() bool

IsEmpty returns true if none of it's fields are set

func (DatasetRef) IsPeerRef

func (r DatasetRef) IsPeerRef() bool

IsPeerRef returns true if only Peername is set

func (DatasetRef) Match

func (r DatasetRef) Match(b DatasetRef) bool

Match checks returns true if Peername and Name are equal, and/or path is equal

func (DatasetRef) String

func (r DatasetRef) String() (s string)

String implements the Stringer interface for DatasetRef

Jump to

Keyboard shortcuts

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