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 CanResolveEvents(left repo.Event, right repo.Event) bool
- func ConnectedQriProfiles(node *p2p.QriNode) (map[profile.ID]*config.ProfilePod, error)
- func ConvertBodyFile(file qfs.File, in, out *dataset.Structure, limit, offset int, all bool) (data []byte, 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, scriptOut io.Writer, ...) error
- func GetBody(node *p2p.QriNode, ds *dataset.Dataset, format dataset.DataFormat, ...) (data []byte, err error)
- func InitIPFS(path string, cfgData []byte, g gen.CryptoGenerator) error
- func ListDatasets(node *p2p.QriNode, ds *repo.DatasetRef, limit, offset int, ...) (res []repo.DatasetRef, err error)
- func ListPeers(node *p2p.QriNode, limit, offset int, onlineOnly bool) ([]*config.ProfilePod, error)
- func Missing(node *p2p.QriNode, m *dag.Manifest) (missing *dag.Manifest, err error)
- func ModifyDataset(node *p2p.QriNode, current, new *repo.DatasetRef, isRename bool) (err error)
- func NewManifest(node *p2p.QriNode, path string) (*dag.Manifest, error)
- func Pin(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func Publish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func Recall(node *p2p.QriNode, str string, ref repo.DatasetRef) (*dataset.Dataset, error)
- func RegistryDataset(node *p2p.QriNode, ds *repo.DatasetRef) error
- func RegistryList(node *p2p.QriNode, limit, offset int) (datasets []*repo.DatasetRef, err error)
- func ResolveDatasetRef(node *p2p.QriNode, ref *repo.DatasetRef) (local bool, err error)
- func SaveDataset(node *p2p.QriNode, changes *dataset.Dataset, secrets map[string]string, ...) (ref repo.DatasetRef, err error)
- func SetPublishStatus(node *p2p.QriNode, ref *repo.DatasetRef, published bool) (err error)
- func Setup(repoPath, cfgPath string, cfg *config.Config, register bool) error
- func Teardown(repoPath string, cfg *config.Config) error
- func Unpin(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func Unpublish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
- func UpdateRemoteDataset(node *p2p.QriNode, ref *repo.DatasetRef, pin bool) (res repo.DatasetRef, err error)
- func Validate(node *p2p.QriNode, ref repo.DatasetRef, body, schema qfs.File) (errors []jsonschema.ValError, err error)
- type MergeResultEntry
- type MergeResultSet
Constants ¶
This section is empty.
Variables ¶
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 CanResolveEvents ¶
CanResolveEvents determines whether two Events can be resolved, or if they conflict.
func ConnectedQriProfiles ¶
ConnectedQriProfiles returns a map from ProfileIDs to profiles for each connected node
func ConvertBodyFile ¶ added in v0.5.4
func ConvertBodyFile(file qfs.File, in, out *dataset.Structure, limit, offset int, all bool) (data []byte, err error)
ConvertBodyFile takes an input file & structure, and converts a specified selection to the structure specified by out
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, scriptOut io.Writer, mutateCheck func(...string) error) error
ExecTransform executes a designated transformation
func GetBody ¶ added in v0.7.0
func GetBody(node *p2p.QriNode, ds *dataset.Dataset, format dataset.DataFormat, fcfg dataset.FormatConfig, limit, offset int, all bool) (data []byte, err error)
GetBody grabs some or all of a dataset's body, writing an output in the desired format
func InitIPFS ¶
func InitIPFS(path string, cfgData []byte, g gen.CryptoGenerator) error
InitIPFS initializes an IPFS repo
func ListDatasets ¶
func ListDatasets(node *p2p.QriNode, ds *repo.DatasetRef, limit, offset int, RPC, publishedOnly bool) (res []repo.DatasetRef, err error)
ListDatasets lists a peer's datasets
func Missing ¶ added in v0.6.1
Missing returns a manifest describing blocks that are not in this node for a given manifest
func ModifyDataset ¶ added in v0.6.2
ModifyDataset alters a reference by changing what dataset it refers to
func NewManifest ¶ added in v0.6.1
NewManifest generates a manifest for a given node
func Pin ¶ added in v0.6.1
func Pin(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Pin asks a registry to host a copy of a dataset
func Publish ¶
func Publish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Publish a dataset to a repo's specified registry
func RegistryDataset ¶ added in v0.6.1
func RegistryDataset(node *p2p.QriNode, ds *repo.DatasetRef) error
RegistryDataset gets dataset info published to the registry, which is usually subset of the full dataset, and not suitable for hash-referencing.
func RegistryList ¶ added in v0.6.1
RegistryList gets a list of the published datasets of a repo's specific registry
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 SaveDataset ¶ added in v0.6.0
func SaveDataset(node *p2p.QriNode, changes *dataset.Dataset, secrets map[string]string, scriptOut io.Writer, dryRun, pin, convertFormatToPrev bool) (ref repo.DatasetRef, err error)
SaveDataset initializes a dataset from a dataset pointer and data file
func SetPublishStatus ¶ added in v0.6.0
SetPublishStatus configures the publish status of a stored reference
func Teardown ¶
Teardown reverses the setup process, destroying a user's privateKey and removing local qri data
func Unpin ¶ added in v0.6.1
func Unpin(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Unpin reverses the pin process
func Unpublish ¶
func Unpublish(node *p2p.QriNode, ref repo.DatasetRef) (err error)
Unpublish a dataset from a repo's specified registry
func UpdateRemoteDataset ¶ added in v0.7.0
func UpdateRemoteDataset(node *p2p.QriNode, ref *repo.DatasetRef, pin bool) (res repo.DatasetRef, err error)
UpdateRemoteDataset brings a reference to the latest version, syncing to the latest history it can find over p2p & via any configured 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.