Documentation ¶
Overview ¶
Package lib implements core qri business logic. It exports canonical methods that a qri instance can perform regardless of client interface. API's of any sort must use lib methods
Index ¶
- Constants
- Variables
- func AbsPath(path *string) (err error)
- func CheckVersion(ctx context.Context, res namesys.Resolver, lookupAddr, localHash string) (latest string, err error)
- func DefaultSelectedRef(r repo.Repo, ref *repo.DatasetRef) (err error)
- func DefaultSelectedRefs(r repo.Repo, refs *[]repo.DatasetRef) (err error)
- func GetConfig(p *GetConfigParams, res *[]byte) error
- func LoadConfig(streams ioes.IOStreams, path string) (err error)
- func ReadDatasetFiles(pathList ...string) (*dataset.Dataset, error)
- func SetConfig(res *config.Config) error
- func Setup(p SetupParams) error
- func Teardown(p TeardownParams) error
- type CompleteParams
- type DAGInfoParams
- type DatasetRequests
- func (r *DatasetRequests) Add(ref *repo.DatasetRef, res *repo.DatasetRef) (err error)
- func (DatasetRequests) CoreRequestsName() string
- func (r *DatasetRequests) DAGInfo(s *DAGInfoParams, i *dag.Info) (err error)
- func (r *DatasetRequests) Diff(p *DiffParams, res *DiffResponse) (err error)
- func (r *DatasetRequests) Get(p *GetParams, res *GetResult) (err error)
- func (r *DatasetRequests) List(p *ListParams, res *[]repo.DatasetRef) error
- func (r *DatasetRequests) Manifest(refstr *string, m *dag.Manifest) (err error)
- func (r *DatasetRequests) ManifestMissing(a, b *dag.Manifest) (err error)
- func (r *DatasetRequests) Remove(p *RemoveParams, res *RemoveResponse) error
- func (r *DatasetRequests) Rename(p *RenameParams, res *repo.DatasetRef) (err error)
- func (r *DatasetRequests) Save(p *SaveParams, res *repo.DatasetRef) (err error)
- func (r *DatasetRequests) SetPublishStatus(p *SetPublishStatusParams, publishedRef *repo.DatasetRef) (err error)
- func (r *DatasetRequests) Update(p *UpdateParams, res *repo.DatasetRef) error
- func (r *DatasetRequests) Validate(p *ValidateDatasetParams, errors *[]jsonschema.ValError) (err error)
- type Delta
- type DiffParams
- type DiffResponse
- type DiffStat
- type Error
- type ExportParams
- type ExportRequests
- type FileParams
- type GetConfigParams
- type GetParams
- type GetResult
- type ListParams
- type LogParams
- type LogRequests
- type PeerConnectionParamsPod
- type PeerInfoParams
- type PeerListParams
- type PeerRefsParams
- type PeerRequests
- func (d *PeerRequests) ConnectToPeer(p *PeerConnectionParamsPod, res *config.ProfilePod) error
- func (d *PeerRequests) ConnectedIPFSPeers(limit *int, peers *[]string) error
- func (d *PeerRequests) ConnectedQriProfiles(limit *int, peers *[]*config.ProfilePod) (err error)
- func (d PeerRequests) CoreRequestsName() string
- func (d *PeerRequests) DisconnectFromPeer(p *PeerConnectionParamsPod, res *bool) error
- func (d *PeerRequests) GetReferences(p *PeerRefsParams, res *[]repo.DatasetRef) error
- func (d *PeerRequests) Info(p *PeerInfoParams, res *config.ProfilePod) error
- func (d *PeerRequests) List(p *PeerListParams, res *[]*config.ProfilePod) (err error)
- type ProfileRequests
- func (ProfileRequests) CoreRequestsName() string
- func (r *ProfileRequests) GetProfile(in *bool, res *config.ProfilePod) (err error)
- func (r *ProfileRequests) PosterPhoto(req *config.ProfilePod, res *[]byte) (err error)
- func (r *ProfileRequests) ProfilePhoto(req *config.ProfilePod, res *[]byte) (err error)
- func (r *ProfileRequests) SaveProfile(p *config.ProfilePod, res *config.ProfilePod) error
- func (r *ProfileRequests) SetPosterPhoto(p *FileParams, res *config.ProfilePod) error
- func (r *ProfileRequests) SetProfilePhoto(p *FileParams, res *config.ProfilePod) error
- type PushParams
- type ReceiveParams
- type ReceiveResult
- type RegistryListParams
- type RegistryRequests
- func (RegistryRequests) CoreRequestsName() string
- func (r *RegistryRequests) GetDataset(ref *repo.DatasetRef, res *repo.DatasetRef) error
- func (r *RegistryRequests) List(params *RegistryListParams, done *bool) error
- func (r *RegistryRequests) Pin(ref *repo.DatasetRef, done *bool) (err error)
- func (r *RegistryRequests) Publish(ref *repo.DatasetRef, done *bool) (err error)
- func (r *RegistryRequests) Unpin(ref *repo.DatasetRef, done *bool) error
- func (r *RegistryRequests) Unpublish(ref *repo.DatasetRef, done *bool) error
- type RemoteRequests
- type RemoveParams
- type RemoveResponse
- type RenameParams
- type RenderParams
- type RenderRequests
- type Requests
- type SaveParams
- type SearchParams
- type SearchRequests
- type SearchResult
- type SelectionRequests
- type SetPublishStatusParams
- type SetupParams
- type TeardownParams
- type UpdateParams
- type ValidateDatasetParams
Constants ¶
const DefaultPageSize = 100
DefaultPageSize is the max number of items in a page if no Limit param is provided to a paginated method
const VersionNumber = "0.7.3"
VersionNumber is the current version qri
Variables ¶
var ( // Config is the global configuration object Config *config.Config // ConfigFilepath is the default location for a config file ConfigFilepath string )
var ( // LastPubVerHash is a hard-coded reference the gx "lastpubver" file of the previous release LastPubVerHash = "/ipfs/QmcXZCLAgUdvXpt1fszjNGVGn6WnhsrJahkQXY3JJqxUWJ" // PrevIPNSName is the dnslink address to check for version agreement PrevIPNSName = "/ipns/cli.previous.qri.io" // ErrUpdateRequired means this version of qri is out of date ErrUpdateRequired = fmt.Errorf("update required") )
var ErrBadArgs = errors.New("bad arguments provided")
ErrBadArgs is an error for when a user provides bad arguments
var SaveConfig = func() error { if err := Config.WriteToFile(ConfigFilepath); err != nil { return fmt.Errorf("error saving profile: %s", err) } return nil }
SaveConfig is a function that updates the configuration file
Functions ¶
func AbsPath ¶ added in v0.6.0
AbsPath adjusts the provided string to a path lib functions can work with because paths for Qri can come from the local filesystem, an http url, or the distributed web, Absolutizing is a little tricky
If lib in put params call for a path, running input through AbsPath before calling a lib function should help reduce errors. calling AbsPath on empty string has no effect
func CheckVersion ¶
func CheckVersion(ctx context.Context, res namesys.Resolver, lookupAddr, localHash string) (latest string, err error)
CheckVersion uses a name resolver to lookup prevIPNSName, checking if the hard-coded lastPubVerHash and the returned lookup match. If they don't, CheckVersion returns ErrUpdateRequired
func DefaultSelectedRef ¶
func DefaultSelectedRef(r repo.Repo, ref *repo.DatasetRef) (err error)
DefaultSelectedRef sets ref to the first selected reference if the provided ref is empty
func DefaultSelectedRefs ¶
func DefaultSelectedRefs(r repo.Repo, refs *[]repo.DatasetRef) (err error)
DefaultSelectedRefs adds selected references to refs if no refs are provided
func GetConfig ¶
func GetConfig(p *GetConfigParams, res *[]byte) error
GetConfig returns the Config, or one of the specified fields of the Config, as a slice of bytes the bytes can be formatted as json, concise json, or yaml
func LoadConfig ¶
LoadConfig loads the global default configuration
func ReadDatasetFiles ¶ added in v0.7.3
ReadDatasetFiles reads zero or more files, each representing a dataset or component of a dataset, and deserializes them, merging the results into a single dataset object. It is an error to provide any combination of files whose contents overlap (modify the same component).
func Setup ¶
func Setup(p SetupParams) error
Setup provisions a new qri instance, it intentionally doesn't conform to the RPC function signature because remotely invoking setup doesn't make much sense
func Teardown ¶
func Teardown(p TeardownParams) error
Teardown reverses the setup process, destroying a user's privateKey and removing local qri data
Types ¶
type CompleteParams ¶ added in v0.7.3
type CompleteParams struct {
SessionID string
}
CompleteParams holds parameters to send when completing a dsync sent to a remote
type DAGInfoParams ¶ added in v0.7.3
type DAGInfoParams struct {
RefStr, Label string
}
DAGInfoParams defines parameters for the DAGInfo method
type DatasetRequests ¶
type DatasetRequests struct {
// contains filtered or unexported fields
}
DatasetRequests encapsulates business logic for working with Datasets on Qri
func NewDatasetRequests ¶
func NewDatasetRequests(node *p2p.QriNode, cli *rpc.Client) *DatasetRequests
NewDatasetRequests creates a DatasetRequests pointer from either a repo or an rpc.Client
func (*DatasetRequests) Add ¶
func (r *DatasetRequests) Add(ref *repo.DatasetRef, res *repo.DatasetRef) (err error)
Add adds an existing dataset to a peer's repository
func (DatasetRequests) CoreRequestsName ¶
func (DatasetRequests) CoreRequestsName() string
CoreRequestsName implements the Requets interface
func (*DatasetRequests) DAGInfo ¶ added in v0.7.3
func (r *DatasetRequests) DAGInfo(s *DAGInfoParams, i *dag.Info) (err error)
DAGInfo generates a dag.Info for a dataset path. If a label is given, DAGInfo will generate a sub-dag.Info at that label.
func (*DatasetRequests) Diff ¶
func (r *DatasetRequests) Diff(p *DiffParams, res *DiffResponse) (err error)
Diff computes the diff of two datasets
func (*DatasetRequests) Get ¶
func (r *DatasetRequests) Get(p *GetParams, res *GetResult) (err error)
Get retrieves datasets and components for a given reference. If p.Ref is provided, it is used to load the dataset, otherwise p.Path is parsed to create a reference. The dataset will be loaded from the local repo if available, or by asking peers for it. Using p.Selector will control what components are returned in res.Bytes. The default, a blank selector, will also fill the entire dataset at res.Data. If the selector is "body" then res.Bytes is loaded with the body.
func (*DatasetRequests) List ¶
func (r *DatasetRequests) List(p *ListParams, res *[]repo.DatasetRef) error
List returns this repo's datasets
func (*DatasetRequests) Manifest ¶ added in v0.6.1
func (r *DatasetRequests) Manifest(refstr *string, m *dag.Manifest) (err error)
Manifest generates a manifest for a dataset path
func (*DatasetRequests) ManifestMissing ¶ added in v0.6.1
func (r *DatasetRequests) ManifestMissing(a, b *dag.Manifest) (err error)
ManifestMissing generates a manifest of blocks that are not present on this repo for a given manifest
func (*DatasetRequests) Remove ¶
func (r *DatasetRequests) Remove(p *RemoveParams, res *RemoveResponse) error
Remove a dataset entirely or remove a certain number of revisions
func (*DatasetRequests) Rename ¶
func (r *DatasetRequests) Rename(p *RenameParams, res *repo.DatasetRef) (err error)
Rename changes a user's given name for a dataset
func (*DatasetRequests) Save ¶
func (r *DatasetRequests) Save(p *SaveParams, res *repo.DatasetRef) (err error)
Save adds a history entry, updating a dataset TODO - need to make sure users aren't forking by referencing commits other than tip
func (*DatasetRequests) SetPublishStatus ¶ added in v0.6.0
func (r *DatasetRequests) SetPublishStatus(p *SetPublishStatusParams, publishedRef *repo.DatasetRef) (err error)
SetPublishStatus updates the publicity of a reference in the peer's namespace
func (*DatasetRequests) Update ¶ added in v0.6.0
func (r *DatasetRequests) Update(p *UpdateParams, res *repo.DatasetRef) error
Update advances a dataset to the latest known version from either a peer or by re-running a transform in the peer's namespace
func (*DatasetRequests) Validate ¶
func (r *DatasetRequests) Validate(p *ValidateDatasetParams, errors *[]jsonschema.ValError) (err error)
Validate gives a dataset of errors and issues for a given dataset
type Delta ¶ added in v0.7.1
Delta is an alias for deepdiff.Delta, abstracting the deepdiff implementation away from packages that depend on lib
type DiffParams ¶
type DiffParams struct {
LeftPath, RightPath string
Selector string
Concise bool
Limit, Offset int
All bool
}
DiffParams defines parameters for diffing two datasets with Diff
type DiffResponse ¶ added in v0.7.1
DiffResponse is the result of a call to diff
type DiffStat ¶ added in v0.7.1
DiffStat is an alias for deepdiff.Stat, abstracting the deepdiff implementation away from packages that depend on lib
type Error ¶ added in v0.5.1
type Error struct {
// contains filtered or unexported fields
}
Error wraps an error and satisfies the error interface It couples more developer focused errors with more user-friendly errors. If a msg exists, you can send an e.Message() to the user, rather than the standard error
type ExportParams ¶ added in v0.6.2
ExportParams defines parameters for the export method
type ExportRequests ¶ added in v0.6.2
type ExportRequests struct {
// contains filtered or unexported fields
}
ExportRequests encapsulates business logic of export operation
func NewExportRequests ¶ added in v0.6.2
func NewExportRequests(node *p2p.QriNode, cli *rpc.Client) *ExportRequests
NewExportRequests creates a ExportRequests pointer from either a repo or an rpc.Client
func (ExportRequests) CoreRequestsName ¶ added in v0.6.2
func (r ExportRequests) CoreRequestsName() string
CoreRequestsName implements the Requests interface
func (*ExportRequests) Export ¶ added in v0.6.2
func (r *ExportRequests) Export(p *ExportParams, fileWritten *string) (err error)
Export exports a dataset in the specified format
type FileParams ¶
type FileParams struct { // Url string // url to download data from. either Url or Data is required Filename string // filename of data file. extension is used for filetype detection Data io.Reader // reader of structured data. either Url or Data is required }
FileParams defines parameters for Files as arguments to lib methods
type GetConfigParams ¶
GetConfigParams are the params needed to format/specify the fields in bytes returned from the GetConfig function
type GetParams ¶
type GetParams struct { // Path to get, this will often be a dataset reference like me/dataset Path string Format string FormatConfig dataset.FormatConfig Selector string Concise bool Limit, Offset int All bool }
GetParams defines parameters for looking up the body of a dataset
type ListParams ¶
type ListParams struct { ProfileID profile.ID Peername string OrderBy string Limit int Offset int // RPC is a horrible hack while we work to replace the net/rpc package // TODO - remove this RPC bool // Published only applies to listing datasets Published bool // ShowNumVersions only applies to listing datasets ShowNumVersions bool }
ListParams is the general input for any sort of Paginated Request ListParams define limits & offsets, not pages & page sizes. TODO - rename this to PageParams.
func ListParamsFromRequest ¶
func ListParamsFromRequest(r *http.Request) ListParams
ListParamsFromRequest extracts ListParams from an http.Request pointer
func NewListParams ¶
func NewListParams(orderBy string, page, pageSize int) ListParams
NewListParams creates a ListParams from page & pagesize, pages are 1-indexed (the first element is 1, not 0), NewListParams performs the conversion
func (ListParams) Page ¶
func (lp ListParams) Page() util.Page
Page converts a ListParams struct to a util.Page struct
type LogParams ¶
type LogParams struct { ListParams // Reference to data to fetch history for Ref repo.DatasetRef }
LogParams defines parameters for the Log method
type LogRequests ¶ added in v0.5.2
type LogRequests struct {
// contains filtered or unexported fields
}
LogRequests encapsulates business logic for the log of changes to datasets, think "git log"
func NewLogRequests ¶ added in v0.5.2
func NewLogRequests(node *p2p.QriNode, cli *rpc.Client) *LogRequests
NewLogRequests creates a LogRequests pointer from either a repo or an rpc.Client
func (LogRequests) CoreRequestsName ¶ added in v0.5.2
func (r LogRequests) CoreRequestsName() string
CoreRequestsName implements the Requets interface
func (*LogRequests) Log ¶ added in v0.5.2
func (r *LogRequests) Log(params *LogParams, res *[]repo.DatasetRef) (err error)
Log returns the history of changes for a given dataset
type PeerConnectionParamsPod ¶
type PeerConnectionParamsPod struct { Peername string ProfileID string NetworkID string Multiaddr string }
PeerConnectionParamsPod defines parameters for defining a connection to a peer as plain-old-data
func NewPeerConnectionParamsPod ¶
func NewPeerConnectionParamsPod(s string) *PeerConnectionParamsPod
NewPeerConnectionParamsPod attempts to turn a string into peer connection parameters
func (PeerConnectionParamsPod) Decode ¶
func (p PeerConnectionParamsPod) Decode() (cp p2p.PeerConnectionParams, err error)
Decode turns plain-old-data into it's rich types
type PeerInfoParams ¶
type PeerInfoParams struct { Peername string ProfileID profile.ID // Verbose adds network details from the p2p Peerstore Verbose bool }
PeerInfoParams defines parameters for the Info method
type PeerListParams ¶
type PeerListParams struct {
Limit, Offset int
// Cached == true will return offline peers from the repo
// as well as online peers, default is to list connected peers only
Cached bool
}
PeerListParams defines parameters for the List method
type PeerRefsParams ¶
PeerRefsParams defines params for the GetReferences method
type PeerRequests ¶
type PeerRequests struct {
// contains filtered or unexported fields
}
PeerRequests encapsulates business logic for methods relating to peer-to-peer interaction
func NewPeerRequests ¶
func NewPeerRequests(node *p2p.QriNode, cli *rpc.Client) *PeerRequests
NewPeerRequests creates a PeerRequests pointer from either a qri Node or an rpc.Client
func (*PeerRequests) ConnectToPeer ¶
func (d *PeerRequests) ConnectToPeer(p *PeerConnectionParamsPod, res *config.ProfilePod) error
ConnectToPeer attempts to create a connection with a peer for a given peer.ID
func (*PeerRequests) ConnectedIPFSPeers ¶
func (d *PeerRequests) ConnectedIPFSPeers(limit *int, peers *[]string) error
ConnectedIPFSPeers lists PeerID's we're currently connected to. If running IPFS this will also return connected IPFS nodes
func (*PeerRequests) ConnectedQriProfiles ¶
func (d *PeerRequests) ConnectedQriProfiles(limit *int, peers *[]*config.ProfilePod) (err error)
ConnectedQriProfiles lists profiles we're currently connected to
func (PeerRequests) CoreRequestsName ¶
func (d PeerRequests) CoreRequestsName() string
CoreRequestsName implements the Requets interface
func (*PeerRequests) DisconnectFromPeer ¶
func (d *PeerRequests) DisconnectFromPeer(p *PeerConnectionParamsPod, res *bool) error
DisconnectFromPeer explicitly closes a peer connection
func (*PeerRequests) GetReferences ¶
func (d *PeerRequests) GetReferences(p *PeerRefsParams, res *[]repo.DatasetRef) error
GetReferences lists a peer's named datasets
func (*PeerRequests) Info ¶
func (d *PeerRequests) Info(p *PeerInfoParams, res *config.ProfilePod) error
Info shows peer profile details
func (*PeerRequests) List ¶
func (d *PeerRequests) List(p *PeerListParams, res *[]*config.ProfilePod) (err error)
List lists Peers on the qri network
type ProfileRequests ¶
type ProfileRequests struct {
// contains filtered or unexported fields
}
ProfileRequests encapsulates business logic for this node's user profile
func NewProfileRequests ¶
func NewProfileRequests(node *p2p.QriNode, cli *rpc.Client) *ProfileRequests
NewProfileRequests creates a ProfileRequests pointer from either a repo or an rpc.Client
func (ProfileRequests) CoreRequestsName ¶
func (ProfileRequests) CoreRequestsName() string
CoreRequestsName implements the Request interface
func (*ProfileRequests) GetProfile ¶
func (r *ProfileRequests) GetProfile(in *bool, res *config.ProfilePod) (err error)
GetProfile get's this node's peer profile
func (*ProfileRequests) PosterPhoto ¶
func (r *ProfileRequests) PosterPhoto(req *config.ProfilePod, res *[]byte) (err error)
PosterPhoto fetches the byte slice of a given user's poster photo
func (*ProfileRequests) ProfilePhoto ¶
func (r *ProfileRequests) ProfilePhoto(req *config.ProfilePod, res *[]byte) (err error)
ProfilePhoto fetches the byte slice of a given user's profile photo
func (*ProfileRequests) SaveProfile ¶
func (r *ProfileRequests) SaveProfile(p *config.ProfilePod, res *config.ProfilePod) error
SaveProfile stores changes to this peer's editable profile
func (*ProfileRequests) SetPosterPhoto ¶
func (r *ProfileRequests) SetPosterPhoto(p *FileParams, res *config.ProfilePod) error
SetPosterPhoto changes this peer's poster image
func (*ProfileRequests) SetProfilePhoto ¶
func (r *ProfileRequests) SetProfilePhoto(p *FileParams, res *config.ProfilePod) error
SetProfilePhoto changes this peer's profile image
type PushParams ¶ added in v0.7.3
PushParams holds parameters for pushing daginfo to remotes
type ReceiveParams ¶ added in v0.7.3
ReceiveParams hold parameters for receiving daginfo's when running as a remote
type ReceiveResult ¶ added in v0.7.3
ReceiveResult is the result of receiving a posted dataset when running as a remote
type RegistryListParams ¶ added in v0.6.1
type RegistryListParams struct { Refs []*repo.DatasetRef Limit int Offset int }
RegistryListParams encapsulates arguments to the publish method
type RegistryRequests ¶
type RegistryRequests struct {
// contains filtered or unexported fields
}
RegistryRequests defines business logic for working with registries
func NewRegistryRequests ¶
func NewRegistryRequests(node *p2p.QriNode, cli *rpc.Client) *RegistryRequests
NewRegistryRequests creates a RegistryRequests pointer from either a repo or an rpc.Client
func (RegistryRequests) CoreRequestsName ¶
func (RegistryRequests) CoreRequestsName() string
CoreRequestsName implements the Requests interface
func (*RegistryRequests) GetDataset ¶ added in v0.6.1
func (r *RegistryRequests) GetDataset(ref *repo.DatasetRef, res *repo.DatasetRef) error
GetDataset returns a dataset that has been published to the registry
func (*RegistryRequests) List ¶ added in v0.6.1
func (r *RegistryRequests) List(params *RegistryListParams, done *bool) error
List returns the list of datasets that have been published to a registry
func (*RegistryRequests) Pin ¶ added in v0.6.1
func (r *RegistryRequests) Pin(ref *repo.DatasetRef, done *bool) (err error)
Pin asks a registry to host a copy of a dataset
func (*RegistryRequests) Publish ¶
func (r *RegistryRequests) Publish(ref *repo.DatasetRef, done *bool) (err error)
Publish a dataset to a registry
func (*RegistryRequests) Unpin ¶ added in v0.6.1
func (r *RegistryRequests) Unpin(ref *repo.DatasetRef, done *bool) error
Unpin reverses the pin process, asking a registry to stop hosting a copy of an already-pinned dataset
func (*RegistryRequests) Unpublish ¶
func (r *RegistryRequests) Unpublish(ref *repo.DatasetRef, done *bool) error
Unpublish a dataset from a registry
type RemoteRequests ¶ added in v0.7.3
type RemoteRequests struct { Receivers *dsync.Receivers Sessions map[string]*ReceiveParams // contains filtered or unexported fields }
RemoteRequests encapsulates business logic of remote operation
func NewRemoteRequests ¶ added in v0.7.3
func NewRemoteRequests(node *p2p.QriNode, cli *rpc.Client) *RemoteRequests
NewRemoteRequests creates a RemoteRequests pointer from either a node or an rpc.Client
func (*RemoteRequests) Complete ¶ added in v0.7.3
func (r *RemoteRequests) Complete(p *CompleteParams, res *bool) (err error)
Complete is used to complete a dataset that has been pushed to this remote
func (RemoteRequests) CoreRequestsName ¶ added in v0.7.3
func (RemoteRequests) CoreRequestsName() string
CoreRequestsName implements the Requests interface
func (*RemoteRequests) PushToRemote ¶ added in v0.7.3
func (r *RemoteRequests) PushToRemote(p *PushParams, out *bool) error
PushToRemote posts a dagInfo to a remote
func (*RemoteRequests) Receive ¶ added in v0.7.3
func (r *RemoteRequests) Receive(p *ReceiveParams, res *ReceiveResult) (err error)
Receive is used to save a dataset when running as a remote. API only, not RPC or command-line.
type RemoveParams ¶ added in v0.6.2
RemoveParams defines parameters for remove command
type RemoveResponse ¶ added in v0.7.0
RemoveResponse gives the results of a remove
type RenameParams ¶
type RenameParams struct {
Current, New repo.DatasetRef
}
RenameParams defines parameters for Dataset renaming
type RenderParams ¶
RenderParams defines parameters for the Render method
type RenderRequests ¶
type RenderRequests struct {
// contains filtered or unexported fields
}
RenderRequests encapsulates business logic for this node's user profile
func NewRenderRequests ¶
func NewRenderRequests(r repo.Repo, cli *rpc.Client) *RenderRequests
NewRenderRequests creates a RenderRequests pointer from either a repo or an rpc.Client
func (RenderRequests) CoreRequestsName ¶
func (RenderRequests) CoreRequestsName() string
CoreRequestsName implements the Requets interface
func (*RenderRequests) Render ¶
func (r *RenderRequests) Render(p *RenderParams, res *[]byte) (err error)
Render executes a template against a template
type Requests ¶
type Requests interface { // CoreRequestsName confirms participation in the CoreRequests interface while // also giving a human readable string for logging purposes CoreRequestsName() string }
Requests defines a set of library methods
type SaveParams ¶
type SaveParams struct { // dataset to create. If both Dataset and FilePath are provided // dataset values will override any values in the document at FilePath Dataset *dataset.Dataset // absolute path or URL to the list of dataset files or components to load FilePaths []string // secrets for transform execution Secrets map[string]string // option to make dataset private. private data is not currently implimented, // see https://github.com/qri-io/qri/issues/291 for updates Private bool // if true, set saved dataset to published Publish bool // run without saving, returning results DryRun bool // if true, res.Dataset.Body will be a fs.file of the body ReturnBody bool // if true, convert body to the format of the previous version, if applicable ConvertFormatToPrev bool // string of references to recall before saving Recall string // force a new commit, even if no changes are detected Force bool // save a rendered version of the template along with the dataset ShouldRender bool // optional writer to have transform script record standard output to // note: this won't work over RPC, only on local calls ScriptOutput io.Writer }
SaveParams encapsulates arguments to Save
type SearchParams ¶
type SearchParams struct { QueryString string `json:"q"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` }
SearchParams defines paremeters for the search Method
type SearchRequests ¶
type SearchRequests struct {
// contains filtered or unexported fields
}
SearchRequests encapsulates business logic for the qri search command
func NewSearchRequests ¶
func NewSearchRequests(node *p2p.QriNode, cli *rpc.Client) *SearchRequests
NewSearchRequests creates a SearchRequests pointer from either a repo or an rpc.Client
func (SearchRequests) CoreRequestsName ¶
func (sr SearchRequests) CoreRequestsName() string
CoreRequestsName implements the requests
func (*SearchRequests) Search ¶
func (sr *SearchRequests) Search(p *SearchParams, results *[]SearchResult) error
Search queries for items on qri related to given parameters
type SearchResult ¶
type SearchResult struct {
Type, ID string
Value interface{}
}
SearchResult struct
type SelectionRequests ¶
type SelectionRequests struct {
// contains filtered or unexported fields
}
SelectionRequests encapsulates business logic for the qri search command
func NewSelectionRequests ¶
func NewSelectionRequests(r repo.Repo, cli *rpc.Client) *SelectionRequests
NewSelectionRequests creates a SelectionRequests pointer from either a repo or an rpc.Client
func (SelectionRequests) CoreRequestsName ¶
func (r SelectionRequests) CoreRequestsName() string
CoreRequestsName implements the requests
func (*SelectionRequests) SelectedRefs ¶
func (r *SelectionRequests) SelectedRefs(done *bool, sel *[]repo.DatasetRef) (err error)
SelectedRefs gets the current set of selected references
func (*SelectionRequests) SetSelectedRefs ¶
func (r *SelectionRequests) SetSelectedRefs(sel *[]repo.DatasetRef, done *bool) error
SetSelectedRefs sets the current set of selected references
type SetPublishStatusParams ¶ added in v0.6.1
type SetPublishStatusParams struct { Ref string PublishStatus bool UpdateRegistry bool UpdateRegistryPin bool }
SetPublishStatusParams encapsulates parameters for setting the publication status of a dataset
type SetupParams ¶
type SetupParams struct { Config *config.Config QriRepoPath string ConfigFilepath string SetupIPFS bool Register bool IPFSFsPath string SetupIPFSConfigData []byte Generator gen.CryptoGenerator }
SetupParams encapsulates arguments for Setup
type TeardownParams ¶
TeardownParams encapsulates arguments for Setup
type UpdateParams ¶ added in v0.6.0
type UpdateParams struct { Ref string Title string Message string Recall string Secrets map[string]string Publish bool DryRun bool ReturnBody bool ShouldRender bool // optional writer to have transform script record standard output to // note: this won't work over RPC, only on local calls ScriptOutput io.Writer }
UpdateParams defines parameters for the Update command TODO (b5): I think we can merge this into SaveParams
type ValidateDatasetParams ¶
type ValidateDatasetParams struct { Ref repo.DatasetRef // URL string DataFilename string Data io.Reader Schema io.Reader }
ValidateDatasetParams defines parameters for dataset data validation
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package test defines utilities for testing the lib package, including caches of expensive processes like cryptographic key generation and ipfs repo creation
|
Package test defines utilities for testing the lib package, including caches of expensive processes like cryptographic key generation and ipfs repo creation |