Documentation ¶
Overview ¶
Package actions provides canonical business logic that operates on Repos to get higher-order functionality. Actions use only Repo methods to do their work, allowing them to be used across any repo.Repo implementation
Index ¶
- Variables
- func AddDataset(node *p2p.QriNode, ref *repo.DatasetRef) (err error)
- func ApplyPath(ds *dataset.DatasetPod, path string) (interface{}, error)
- func CanResolveEvents(left repo.Event, right repo.Event) bool
- func ConnectedQriProfiles(node *p2p.QriNode, limit int) ([]*config.ProfilePod, error)
- func CreateDataset(node *p2p.QriNode, name string, ds *dataset.Dataset, data cafs.File, ...) (ref repo.DatasetRef, body cafs.File, err error)
- func DatasetHead(node *p2p.QriNode, ds *repo.DatasetRef) error
- func DatasetLog(node *p2p.QriNode, ref repo.DatasetRef, limit, offset int) (rlog []repo.DatasetRef, err error)
- func DeleteDataset(node *p2p.QriNode, ref *repo.DatasetRef) (err error)
- func DiffDatasets(node *p2p.QriNode, leftRef, rightRef repo.DatasetRef, all bool, ...) (diffs map[string]*dsdiff.SubDiff, err error)
- func ExecTransform(node *p2p.QriNode, ds *dataset.Dataset, infile cafs.File, ...) (file cafs.File, err error)
- func InitIPFS(path string, cfgData []byte) error
- func ListDatasets(node *p2p.QriNode, ds *repo.DatasetRef, limit, offset int, RPC bool) (res []repo.DatasetRef, err error)
- func ListPeers(node *p2p.QriNode, limit, offset int, onlineOnly bool) ([]*config.ProfilePod, error)
- func LookupBody(node *p2p.QriNode, path string, format dataset.DataFormat, ...) (bodyPath string, data []byte, err error)
- func NewDataset(dsp *dataset.DatasetPod) (ds *dataset.Dataset, body cafs.File, secrets map[string]string, err error)
- func PinDataset(r repo.Repo, ref repo.DatasetRef) error
- func PrepareViz(ds *dataset.Dataset) (err error)
- func Publish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func ReadDataset(r repo.Repo, ref *repo.DatasetRef) (err error)
- func RenameDataset(node *p2p.QriNode, current, new *repo.DatasetRef) (err error)
- func Render(r repo.Repo, ref repo.DatasetRef, tmplData []byte, limit, offest int, all bool) ([]byte, error)
- func ResolveDatasetRef(n *p2p.QriNode, ref *repo.DatasetRef) (local bool, err error)
- func Select(r repo.Repo, ref repo.DatasetRef, path string) (interface{}, error)
- func Setup(repoPath, cfgPath string, cfg *config.Config, register bool) error
- func Status(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func Teardown(repoPath string, cfg *config.Config) error
- func UnpinDataset(r repo.Repo, ref repo.DatasetRef) error
- func Unpublish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func UpdateDataset(node *p2p.QriNode, dsp *dataset.DatasetPod) (ds *dataset.Dataset, body cafs.File, secrets map[string]string, err error)
- func Validate(node *p2p.QriNode, ref repo.DatasetRef, body, schema cafs.File) (errors []jsonschema.ValError, err error)
- type MergeResultEntry
- type MergeResultSet
Constants ¶
This section is empty.
Variables ¶
var DefaultTemplate = `` /* 1860-byte string literal not displayed */
DefaultTemplate is the template that render will fall back to should no template be available
var ErrHandleTaken = fmt.Errorf("handle is taken")
ErrHandleTaken is for when a peername is already taken
Functions ¶
func AddDataset ¶
func AddDataset(node *p2p.QriNode, ref *repo.DatasetRef) (err error)
AddDataset fetches & pins a dataset to the store, adding it to the list of stored refs
func ApplyPath ¶
func ApplyPath(ds *dataset.DatasetPod, path string) (interface{}, error)
ApplyPath gets a dataset value by applying a case.Sensitve.dot.separated.path
func CanResolveEvents ¶
CanResolveEvents determines whether two Events can be resolved, or if they conflict.
func ConnectedQriProfiles ¶
ConnectedQriProfiles gives any currently connected qri profiles to this node
func CreateDataset ¶
func CreateDataset(node *p2p.QriNode, name string, ds *dataset.Dataset, data cafs.File, secrets map[string]string, dryRun, pin bool) (ref repo.DatasetRef, body cafs.File, err error)
CreateDataset initializes a dataset from a dataset pointer and data file
func DatasetHead ¶
func DatasetHead(node *p2p.QriNode, ds *repo.DatasetRef) error
DatasetHead gets commit, structure, meta, viz & transform for a given reference, either from the local repo or by asking peers for it, modifying the input ref on success
func DatasetLog ¶
func DatasetLog(node *p2p.QriNode, ref repo.DatasetRef, limit, offset int) (rlog []repo.DatasetRef, err error)
DatasetLog fetches the history of changes to a dataset
func DeleteDataset ¶
func DeleteDataset(node *p2p.QriNode, ref *repo.DatasetRef) (err error)
DeleteDataset removes a dataset from the store
func DiffDatasets ¶
func DiffDatasets(node *p2p.QriNode, leftRef, rightRef repo.DatasetRef, all bool, components map[string]bool) (diffs map[string]*dsdiff.SubDiff, err error)
DiffDatasets calculates the difference between two dataset references
func ExecTransform ¶
func ExecTransform(node *p2p.QriNode, ds *dataset.Dataset, infile cafs.File, secrets map[string]string) (file cafs.File, err error)
ExecTransform executes a designated transformation
func ListDatasets ¶
func ListDatasets(node *p2p.QriNode, ds *repo.DatasetRef, limit, offset int, RPC bool) (res []repo.DatasetRef, err error)
ListDatasets lists a peer's datasets
func LookupBody ¶
func LookupBody(node *p2p.QriNode, path string, format dataset.DataFormat, fcfg dataset.FormatConfig, limit, offset int, all bool) (bodyPath string, data []byte, err error)
LookupBody grabs a subset of a dataset's body
func NewDataset ¶
func NewDataset(dsp *dataset.DatasetPod) (ds *dataset.Dataset, body cafs.File, secrets map[string]string, err error)
NewDataset processes dataset input into it's necessary components for creation
func PinDataset ¶
func PinDataset(r repo.Repo, ref repo.DatasetRef) error
PinDataset marks a dataset for retention in a store
func PrepareViz ¶
PrepareViz loads vizualization bytes from a local filepath
func Publish ¶
func Publish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Publish a dataset to a repo's specified registry
func ReadDataset ¶
func ReadDataset(r repo.Repo, ref *repo.DatasetRef) (err error)
ReadDataset grabs a dataset from the store
func RenameDataset ¶
func RenameDataset(node *p2p.QriNode, current, new *repo.DatasetRef) (err error)
RenameDataset alters a dataset name
func Render ¶
func Render(r repo.Repo, ref repo.DatasetRef, tmplData []byte, limit, offest int, all bool) ([]byte, error)
Render executes a template for a dataset, returning a slice of HTML
func ResolveDatasetRef ¶
ResolveDatasetRef uses a node to complete the missing pieces of a dataset reference. The most typical example is completing a human ref like peername/dataset_name with content-addressed identifiers It will first attempt to use the local repo to Canonicalize the reference, falling back to a network call if one isn't found TODO - this looks small now, but in the future we may consider reinforcing p2p network with registry lookups
func Status ¶
func Status(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Status checks to see if a dataset is published to a repo's specific registry
func Teardown ¶
Teardown reverses the setup process, destroying a user's privateKey and removing local qri data
func UnpinDataset ¶
func UnpinDataset(r repo.Repo, ref repo.DatasetRef) error
UnpinDataset unmarks a dataset for retention in a store
func Unpublish ¶
func Unpublish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Unpublish a dataset from a repo's specified registry
Types ¶
type MergeResultEntry ¶
type MergeResultEntry struct {
// contains filtered or unexported fields
}
MergeResultEntry contains information about how a single peer should update its EventLog.
func (MergeResultEntry) NumConflicts ¶
func (e MergeResultEntry) NumConflicts() int
NumConflicts gets the number of conflicts.
func (MergeResultEntry) NumUpdates ¶
func (e MergeResultEntry) NumUpdates() int
NumUpdates gets the number of updates.
type MergeResultSet ¶
type MergeResultSet struct {
// contains filtered or unexported fields
}
MergeResultSet contains information about how to merge a collection of EventLogs.
func MergeRepoEvents ¶
MergeRepoEvents tries to merge multiple EventLogs.
func (MergeResultSet) Peer ¶
func (s MergeResultSet) Peer(i int) MergeResultEntry
Peer gets a MegeResultEntry for a single peer.