Documentation ¶
Overview ¶
Package cmd defines the CLI interface. It relies heavily on the spf13/cobra package. Much of its structure is adapted from kubernetes/kubernetes/tree/master/cmd The `help` message for each command uses backticks rather than quotes when referring to commands by name, even though it is cumbersome to maintain. Using backticks means we can get better formatting when auto generating markdown documentation from the command help messages.
Index ¶
- Constants
- Variables
- func DefaultSelectedRefList(f Factory) ([]string, error)
- func ErrExit(w io.Writer, err error)
- func Execute()
- func ExitIfErr(w io.Writer, err error)
- func GetWd() string
- func NewAccessCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewApplyCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewAutocompleteCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewCheckoutCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewConfigCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewConnectCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewDAGCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewDiffCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewFSICommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewGetCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewInitCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewListCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewLogCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewLogbookCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewPeersCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewPreviewCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewPullCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewPushCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewQriCommand(ctx context.Context, repoPath string, generator key.CryptoGenerator, ...) (*cobra.Command, func() <-chan error)
- func NewRegistryCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewRemoveCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewRenameCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewRenderCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewRestoreCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewSQLCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewSaveCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewSearchCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewSetupCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewStatusCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewUseCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewValidateCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewVersionCommand(_ Factory, ioStreams ioes.IOStreams) *cobra.Command
- func NewWhatChangedCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command
- func PrintProgressBarsOnEvents(w io.Writer, bus event.Bus)
- func StandardRepoPath() string
- type AccessOptions
- type ApplyOptions
- type AutocompleteOptions
- type CheckoutOptions
- type ConfigOptions
- type ConnectOptions
- type DAGOptions
- type DiffOptions
- type FSIOptions
- type FSIRefLinkEnsurer
- type Factory
- type GetOptions
- type InitOptions
- type ListOptions
- type LogOptions
- type LogbookOptions
- type PeersOptions
- type PreviewOptions
- type PullOptions
- type PushOptions
- type QriOptions
- func (o *QriOptions) Config() (*config.Config, error)
- func (o *QriOptions) ConnectionNode() (*p2p.QriNode, error)
- func (o *QriOptions) CryptoGenerator() key.CryptoGenerator
- func (o *QriOptions) HTTPClient() *lib.HTTPClient
- func (o *QriOptions) Init() (err error)
- func (o *QriOptions) Instance() (*lib.Instance, error)
- func (o *QriOptions) RepoPath() string
- func (o *QriOptions) Shutdown() <-chan error
- type RefSelect
- func GetCurrentRefSelect(f Factory, args []string, allowed int, ensurer *FSIRefLinkEnsurer) (*RefSelect, error)
- func GetLinkedRefSelect() (*RefSelect, error)
- func NewEmptyRefSelect() *RefSelect
- func NewExplicitRefSelect(ref string) *RefSelect
- func NewLinkedDirectoryRefSelect(ref dsref.Ref, dir string) *RefSelect
- func NewListOfRefSelects(refs []string) *RefSelect
- func NewUsingRefSelect(ref string) *RefSelect
- type RegistryOptions
- type RemoveOptions
- type RenameOptions
- type RenderOptions
- type RestoreOptions
- type SQLOptions
- type SaveOptions
- type SearchOptions
- type SetupOptions
- type StatusOptions
- type UseOptions
- type ValidateOptions
- type WhatChangedOptions
Constants ¶
const ( // ExitCodeOK is a 0 exit code. we're good! success! yay! ExitCodeOK = iota // ExitCodeErr is a generic error exit code, all non-special errors occur here ExitCodeErr // ExitCodeNeedMigration indicates a required migration ExitCodeNeedMigration )
const ( // AnyNumberOfReferences is for commands that can work on any number of dataset references AnyNumberOfReferences = -1 // BadUpperCaseOkayWhenSavingExistingDataset is for the save command, which can have bad // upper-case characters in its reference but only if it already exists BadUpperCaseOkayWhenSavingExistingDataset = -2 )
const ColumnPositionForMtime = 40
ColumnPositionForMtime is the column position at which to display mod times, if requested
const FileSelectedRefs = "/selected_refs.json"
FileSelectedRefs stores selection, is copied from github.com/qri-io/qri/repo/fs/files.go
Variables ¶
var StringerLocation *time.Location
StringerLocation is the function to retrieve the timezone location
Functions ¶
func DefaultSelectedRefList ¶ added in v0.9.0
DefaultSelectedRefList returns the list of currently `use`ing dataset references
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetWd ¶
func GetWd() string
GetWd is a convenience method to get the working directory or bail.
func NewAccessCommand ¶ added in v0.10.0
NewAccessCommand creates a new `qri access` cobra command for managing permissions
func NewApplyCommand ¶ added in v0.10.0
NewApplyCommand creates a new `qri apply` cobra command for applying transformations
func NewAutocompleteCommand ¶ added in v0.9.7
NewAutocompleteCommand creates a new `qri complete` cobra command that prints autocomplete scripts
func NewCheckoutCommand ¶ added in v0.9.0
NewCheckoutCommand creates new `qri checkout` command that connects a working directory in the local filesystem to a dataset your repo.
func NewConfigCommand ¶ added in v0.5.0
NewConfigCommand creates a new `qri config` cobra command config represents commands that read & modify configuration settings
func NewConnectCommand ¶ added in v0.5.0
NewConnectCommand creates a new `qri connect` cobra command for connecting to the d.web, local api, and rpc server
func NewDAGCommand ¶ added in v0.7.3
NewDAGCommand creates a new `qri dag` command that generates a manifest for a given dataset reference. Referenced dataset must be stored in local CAFS
func NewDiffCommand ¶ added in v0.5.0
NewDiffCommand creates a new `qri diff` cobra command for comparing changes between datasets
func NewFSICommand ¶ added in v0.9.0
NewFSICommand creates a new `qri fsi` command for working with file system integration
func NewGetCommand ¶ added in v0.5.0
NewGetCommand creates a new `qri search` command that searches for datasets
func NewInitCommand ¶ added in v0.9.0
NewInitCommand creates new `qri init` command that connects a working directory in the local filesystem to a dataset your repo.
func NewListCommand ¶ added in v0.5.0
NewListCommand creates new `qri list` command that lists datasets for the local peer & others
func NewLogCommand ¶ added in v0.5.0
NewLogCommand creates a new `qri log` cobra command
func NewLogbookCommand ¶ added in v0.9.1
NewLogbookCommand creates a `qri logbook` cobra command
func NewPeersCommand ¶ added in v0.5.0
NewPeersCommand cerates a new `qri peers` cobra command
func NewPreviewCommand ¶ added in v0.9.10
NewPreviewCommand creates a `qri preview` subcommand for fetching dataset prewviews
func NewPullCommand ¶ added in v0.9.10
NewPullCommand creates an add command
func NewPushCommand ¶ added in v0.9.10
NewPushCommand creates a `qri push` subcommand
func NewQriCommand ¶ added in v0.5.0
func NewQriCommand(ctx context.Context, repoPath string, generator key.CryptoGenerator, ioStreams ioes.IOStreams) (*cobra.Command, func() <-chan error)
NewQriCommand represents the base command when called without any subcommands
func NewRegistryCommand ¶ added in v0.5.0
NewRegistryCommand creates a `qri registry` subcommand for working with the configured registry
func NewRemoveCommand ¶ added in v0.5.0
NewRemoveCommand creates a new `qri remove` cobra command for removing datasets from a local repository
func NewRenameCommand ¶ added in v0.5.0
NewRenameCommand creates a new `qri rename` cobra command for renaming datasets
func NewRenderCommand ¶ added in v0.5.0
NewRenderCommand creates a new `qri render` command for executing templates against datasets
func NewRestoreCommand ¶ added in v0.9.0
NewRestoreCommand creates new `qri restore` command
func NewSQLCommand ¶ added in v0.9.7
NewSQLCommand creates a new `qri sql` command for running SQL on datasets
func NewSaveCommand ¶ added in v0.5.0
NewSaveCommand creates a `qri save` cobra command used for saving changes to datasets
func NewSearchCommand ¶ added in v0.5.0
NewSearchCommand creates a new `qri search` command that searches for datasets
func NewSetupCommand ¶ added in v0.5.0
NewSetupCommand creates a setup command
func NewStatusCommand ¶ added in v0.9.0
NewStatusCommand creates a `qri status` command that compares working directory to prev version
func NewUseCommand ¶ added in v0.5.0
NewUseCommand creates a new `qri search` command that searches for datasets
func NewValidateCommand ¶ added in v0.5.0
NewValidateCommand creates a new `qri validate` cobra command for showing schema errors in a dataset body
func NewVersionCommand ¶ added in v0.5.0
NewVersionCommand creates a new `qri version` cobra command that prints the current qri version
func NewWhatChangedCommand ¶ added in v0.9.7
NewWhatChangedCommand creates a new `qri whatchanged` command that shows what changed at a commit
func PrintProgressBarsOnEvents ¶ added in v0.10.0
PrintProgressBarsOnEvents writes save progress data to the given writer
func StandardRepoPath ¶ added in v0.9.9
func StandardRepoPath() string
StandardRepoPath returns qri paths based on the QRI_PATH environment variable falling back to the default: $HOME/.qri
Types ¶
type AccessOptions ¶ added in v0.10.0
AccessOptions encapsulates state for the apply command
func (*AccessOptions) Complete ¶ added in v0.10.0
func (o *AccessOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*AccessOptions) CreateAccessToken ¶ added in v0.10.0
func (o *AccessOptions) CreateAccessToken(ctx context.Context) error
CreateAccessToken constructs an access token suitable for making authenticated requests
type ApplyOptions ¶ added in v0.10.0
type ApplyOptions struct { ioes.IOStreams Instance *lib.Instance Refs *RefSelect FilePath string Secrets []string }
ApplyOptions encapsulates state for the apply command
func (*ApplyOptions) Complete ¶ added in v0.10.0
func (o *ApplyOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*ApplyOptions) Run ¶ added in v0.10.0
func (o *ApplyOptions) Run() error
Run executes the apply command
type AutocompleteOptions ¶ added in v0.9.7
AutocompleteOptions encapsulates completion options
type CheckoutOptions ¶ added in v0.9.0
CheckoutOptions encapsulates state for the `checkout` command
func (*CheckoutOptions) Complete ¶ added in v0.9.0
func (o *CheckoutOptions) Complete(f Factory, args []string) (err error)
Complete configures the checkout command
func (*CheckoutOptions) Run ¶ added in v0.9.0
func (o *CheckoutOptions) Run() (err error)
Run executes the `checkout` command
type ConfigOptions ¶ added in v0.5.0
type ConfigOptions struct { ioes.IOStreams Format string WithPrivateKeys bool Concise bool Output string // contains filtered or unexported fields }
ConfigOptions encapsulates state for the config command
func (*ConfigOptions) Complete ¶ added in v0.5.0
func (o *ConfigOptions) Complete(f Factory) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*ConfigOptions) CompleteConfig ¶ added in v0.9.8
func (o *ConfigOptions) CompleteConfig(f Factory) (err error)
CompleteConfig adds any missing configuration that can only be added just before calling GetConfig
func (*ConfigOptions) Get ¶ added in v0.5.0
func (o *ConfigOptions) Get(args []string) (err error)
Get a configuration option
func (*ConfigOptions) GetConfig ¶ added in v0.9.8
func (o *ConfigOptions) GetConfig(args []string) (err error)
GetConfig gets configuration keys based on a partial key supplied
func (*ConfigOptions) Set ¶ added in v0.5.0
func (o *ConfigOptions) Set(args []string) (err error)
Set a configuration option
type ConnectOptions ¶ added in v0.5.0
type ConnectOptions struct { ioes.IOStreams Registry string Setup bool // contains filtered or unexported fields }
ConnectOptions encapsulates state for the connect command
func (*ConnectOptions) Complete ¶ added in v0.5.0
func (o *ConnectOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*ConnectOptions) Run ¶ added in v0.5.0
func (o *ConnectOptions) Run() error
Run executes the connect command with currently configured state
type DAGOptions ¶ added in v0.7.3
type DAGOptions struct { ioes.IOStreams Refs []string Format string InfoFormat string Pretty bool Hex bool File string Label string // contains filtered or unexported fields }
DAGOptions encapsulates state for the dag command
func (*DAGOptions) Complete ¶ added in v0.7.3
func (o *DAGOptions) Complete(f Factory, args []string, parseLabel bool) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*DAGOptions) Get ¶ added in v0.7.3
func (o *DAGOptions) Get() (err error)
Get executes the manifest get command
func (*DAGOptions) Info ¶ added in v0.7.3
func (o *DAGOptions) Info() (err error)
Info executes the dag info command
func (*DAGOptions) Missing ¶ added in v0.7.3
func (o *DAGOptions) Missing() error
Missing executes the manifest missing command
type DiffOptions ¶ added in v0.5.0
type DiffOptions struct { ioes.IOStreams Refs *RefSelect Selector string Format string Summary bool // contains filtered or unexported fields }
DiffOptions encapsulates options for the diff command
func (*DiffOptions) Complete ¶ added in v0.5.0
func (o *DiffOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*DiffOptions) Run ¶ added in v0.5.0
func (o *DiffOptions) Run() (err error)
Run executes the diff command
type FSIOptions ¶ added in v0.9.0
FSIOptions encapsulates state for the dag command
func (*FSIOptions) Complete ¶ added in v0.9.0
func (o *FSIOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*FSIOptions) Link ¶ added in v0.9.0
func (o *FSIOptions) Link() (err error)
Link creates a FSI link
type FSIRefLinkEnsurer ¶ added in v0.9.9
type FSIRefLinkEnsurer struct {
FSIMethods lib.FSIMethods
}
FSIRefLinkEnsurer is a simple wrapper for ensuring the linkfile agrees with the repository. We use it instead of a raw FSIMethods pointer so that users of this code see they need to call EnsureFSIAgrees(*fsiMethods) when calling GetRefSelect, hopefully providing a bit of insight about what this parameter is for.
func EnsureFSIAgrees ¶ added in v0.9.9
func EnsureFSIAgrees(inst *lib.Instance) *FSIRefLinkEnsurer
EnsureFSIAgrees should be passed to GetCurrentRefSelect in order to ensure that any references used by a command have agreement between what their .qri-ref linkfile thinks and what the qri repository thinks. If there's a disagreement, the linkfile wins and the repository will be updated to match. This is useful if a user has a working directory, and then manually deletes the .qri-ref (which will unlink the dataset), or renames / moves the directory and then runs a command in that directory (which will update the repository with the new working directory's path).
func (*FSIRefLinkEnsurer) EnsureRef ¶ added in v0.9.9
func (e *FSIRefLinkEnsurer) EnsureRef(refs *RefSelect) error
EnsureRef checks if the linkfile and repository agree on the dataset's working directory path. If not, it will modify the repository so that it matches the linkfile. The linkfile will never be modified.
type Factory ¶ added in v0.5.0
type Factory interface { Instance() (*lib.Instance, error) Config() (*config.Config, error) // path to qri data directory RepoPath() string CryptoGenerator() key.CryptoGenerator Init() error HTTPClient() *lib.HTTPClient ConnectionNode() (*p2p.QriNode, error) }
Factory is an interface for providing required structures to cobra commands It's main implementation is QriOptions
type GetOptions ¶ added in v0.5.0
type GetOptions struct { ioes.IOStreams Refs *RefSelect Selector string Format string Page int PageSize int All bool Pretty bool Outfile string Offline bool Remote string // contains filtered or unexported fields }
GetOptions encapsulates state for the get command
func (*GetOptions) Complete ¶ added in v0.5.0
func (o *GetOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*GetOptions) Run ¶ added in v0.5.0
func (o *GetOptions) Run() (err error)
Run executes the get command
type InitOptions ¶ added in v0.9.0
type InitOptions struct { ioes.IOStreams Instance *lib.Instance // Name of the dataset that will be created Name string // Format of the body Format string // Body file to initialize dataset with, if blank an example csv will be used BodyPath string // Path to use as a working directory. Will be created if it does not exist yet. TargetDir string // Experimental: Use dscache subsystem to store dataset references UseDscache bool }
InitOptions encapsulates state for the `init` command
func (*InitOptions) Complete ¶ added in v0.9.0
func (o *InitOptions) Complete(f Factory, args []string) (err error)
Complete completes a dataset reference
func (*InitOptions) Run ¶ added in v0.9.0
func (o *InitOptions) Run() (err error)
Run executes the `init` command
type ListOptions ¶ added in v0.5.0
type ListOptions struct { ioes.IOStreams Format string PageSize int Page int Term string Username string Public bool ShowNumVersions bool Raw bool // contains filtered or unexported fields }
ListOptions encapsulates state for the List command
func (*ListOptions) Complete ¶ added in v0.5.0
func (o *ListOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*ListOptions) Run ¶ added in v0.5.0
func (o *ListOptions) Run() (err error)
Run executes the list command
type LogOptions ¶ added in v0.5.0
type LogOptions struct { ioes.IOStreams PageSize int Page int Refs *RefSelect Local bool Pull bool // remote fetching specific flags Source string Unfetch bool NoRegistry bool NoPin bool Instance *lib.Instance }
LogOptions encapsulates state for the log command
func (*LogOptions) Complete ¶ added in v0.5.0
func (o *LogOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*LogOptions) Run ¶ added in v0.5.0
func (o *LogOptions) Run() error
Run executes the log command
type LogbookOptions ¶ added in v0.9.1
type LogbookOptions struct { ioes.IOStreams PageSize int Page int Refs *RefSelect Raw, Summary bool Instance *lib.Instance }
LogbookOptions encapsulates state for the log command
func (*LogbookOptions) Complete ¶ added in v0.9.1
func (o *LogbookOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*LogbookOptions) LogEntries ¶ added in v0.10.0
func (o *LogbookOptions) LogEntries() error
LogEntries gets entries from the logbook
func (*LogbookOptions) LogbookSummary ¶ added in v0.9.9
func (o *LogbookOptions) LogbookSummary() error
LogbookSummary prints a logbook overview
func (*LogbookOptions) RawLogs ¶ added in v0.9.1
func (o *LogbookOptions) RawLogs() error
RawLogs executes the rawlogs variant of the logbook command
type PeersOptions ¶ added in v0.5.0
type PeersOptions struct { ioes.IOStreams Peername string Verbose bool Format string Cached bool Network string PageSize int Page int UsingRPC bool Instance *lib.Instance }
PeersOptions encapsulates state for the peers command
func (*PeersOptions) Complete ¶ added in v0.5.0
func (o *PeersOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*PeersOptions) Connect ¶ added in v0.5.0
func (o *PeersOptions) Connect() (err error)
Connect attempts to connect to a peer
func (*PeersOptions) Disconnect ¶ added in v0.5.0
func (o *PeersOptions) Disconnect() (err error)
Disconnect attempts to disconnect from a peer
func (*PeersOptions) Info ¶ added in v0.5.0
func (o *PeersOptions) Info() (err error)
Info gets peer info
func (*PeersOptions) List ¶ added in v0.5.0
func (o *PeersOptions) List() (err error)
List shows a list of peers
type PreviewOptions ¶ added in v0.9.10
type PreviewOptions struct { ioes.IOStreams Refs *RefSelect Format string Source string // contains filtered or unexported fields }
PreviewOptions encapsulates state for the publish command
func (*PreviewOptions) Complete ¶ added in v0.9.10
func (o *PreviewOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*PreviewOptions) Run ¶ added in v0.9.10
func (o *PreviewOptions) Run() error
Run executes the publish command
type PullOptions ¶ added in v0.9.10
type PullOptions struct { ioes.IOStreams LinkDir string Source string LogsOnly bool // contains filtered or unexported fields }
PullOptions encapsulates state for the add command
func (*PullOptions) Complete ¶ added in v0.9.10
func (o *PullOptions) Complete(f Factory) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*PullOptions) Run ¶ added in v0.9.10
func (o *PullOptions) Run(args []string) error
Run adds another peer's dataset to this user's repo
type PushOptions ¶ added in v0.9.10
type PushOptions struct { ioes.IOStreams Refs *RefSelect Logs bool Remote string // contains filtered or unexported fields }
PushOptions encapsulates state for the push command
func (*PushOptions) Complete ¶ added in v0.9.10
func (o *PushOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*PushOptions) Run ¶ added in v0.9.10
func (o *PushOptions) Run() error
Run executes the push command
type QriOptions ¶ added in v0.5.0
type QriOptions struct { ioes.IOStreams // automatically run migrations if necessary Migrate bool // NoPrompt Disables all promt messages NoPrompt bool // NoColor disables colorized output NoColor bool // path to configuration object ConfigPath string // Whether to log all activity by enabling logging for all packages LogAll bool // contains filtered or unexported fields }
QriOptions holds the Root Command State
func NewQriOptions ¶ added in v0.5.0
func NewQriOptions(ctx context.Context, repoPath string, generator key.CryptoGenerator, ioStreams ioes.IOStreams) *QriOptions
NewQriOptions creates an options object
func (*QriOptions) Config ¶ added in v0.5.0
func (o *QriOptions) Config() (*config.Config, error)
Config returns from internal state
func (*QriOptions) ConnectionNode ¶ added in v0.6.2
func (o *QriOptions) ConnectionNode() (*p2p.QriNode, error)
ConnectionNode returns the internal QriNode, if it is available
func (*QriOptions) CryptoGenerator ¶ added in v0.5.5
func (o *QriOptions) CryptoGenerator() key.CryptoGenerator
CryptoGenerator returns a resource for generating cryptographic info
func (*QriOptions) HTTPClient ¶ added in v0.10.0
func (o *QriOptions) HTTPClient() *lib.HTTPClient
HTTPClient returns a client for performing RPC over HTTP
func (*QriOptions) Init ¶ added in v0.6.2
func (o *QriOptions) Init() (err error)
Init will initialize the internal state before any command is run (excluding `qri setup`)
func (*QriOptions) Instance ¶ added in v0.8.0
func (o *QriOptions) Instance() (*lib.Instance, error)
Instance returns the instance this options is using
func (*QriOptions) RepoPath ¶ added in v0.8.0
func (o *QriOptions) RepoPath() string
RepoPath returns the path to the qri data directory
func (*QriOptions) Shutdown ¶ added in v0.9.9
func (o *QriOptions) Shutdown() <-chan error
Shutdown closes the instance
type RefSelect ¶ added in v0.9.0
type RefSelect struct {
// contains filtered or unexported fields
}
RefSelect represents zero or more references, either explicitly provided or implied
func GetCurrentRefSelect ¶ added in v0.9.0
func GetCurrentRefSelect(f Factory, args []string, allowed int, ensurer *FSIRefLinkEnsurer) (*RefSelect, error)
GetCurrentRefSelect returns the current reference selection. This could be explicitly provided as command-line arguments, or could be determined by being in a linked directory, or could be selected by the `use` command. This order is also the precedence, from most important to least. This is the recommended method for command-line commands to get references. If an Ensurer is passed in, it is used to ensure that the ref in the .qri-ref linkfile matches what is in the repo.
func GetLinkedRefSelect ¶ added in v0.9.0
GetLinkedRefSelect returns the current reference selection only if it is a linked directory
func NewEmptyRefSelect ¶ added in v0.9.0
func NewEmptyRefSelect() *RefSelect
NewEmptyRefSelect returns an empty reference selection
func NewExplicitRefSelect ¶ added in v0.9.0
NewExplicitRefSelect returns a single explicitly provided reference
func NewLinkedDirectoryRefSelect ¶ added in v0.9.0
NewLinkedDirectoryRefSelect returns a single reference implied by a linked directory
func NewListOfRefSelects ¶ added in v0.9.0
NewListOfRefSelects returns a list of explicitly provided references
func NewUsingRefSelect ¶ added in v0.9.0
NewUsingRefSelect returns a single reference implied by the use command
func (*RefSelect) IsExplicit ¶ added in v0.9.0
IsExplicit returns whether the reference is explicit
func (*RefSelect) IsLinked ¶ added in v0.9.0
IsLinked returns whether the reference is implied by a linked directory
type RegistryOptions ¶ added in v0.5.0
type RegistryOptions struct { ioes.IOStreams Refs []string Username string Password string Email string // contains filtered or unexported fields }
RegistryOptions encapsulates state for the registry command & subcommands
func (*RegistryOptions) Complete ¶ added in v0.5.0
func (o *RegistryOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*RegistryOptions) PromptForPassword ¶ added in v0.9.7
func (o *RegistryOptions) PromptForPassword() (string, error)
PromptForPassword will prompt the user for a password without echoing it to the screen
func (*RegistryOptions) Prove ¶ added in v0.9.0
func (o *RegistryOptions) Prove() error
Prove associates a keypair with an account
func (*RegistryOptions) Signup ¶ added in v0.9.0
func (o *RegistryOptions) Signup() error
Signup registers a handle with the registry
type RemoveOptions ¶ added in v0.5.0
type RemoveOptions struct { ioes.IOStreams Refs *RefSelect Remote string RevisionsText string Revision *dsref.Rev All bool KeepFiles bool Force bool // contains filtered or unexported fields }
RemoveOptions encapsulates state for the remove command
func (*RemoveOptions) Complete ¶ added in v0.5.0
func (o *RemoveOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*RemoveOptions) RemoveRemote ¶ added in v0.9.10
func (o *RemoveOptions) RemoveRemote() error
RemoveRemote runs the remove command as a network request to a remote
func (*RemoveOptions) Run ¶ added in v0.5.0
func (o *RemoveOptions) Run() (err error)
Run executes the remove command
func (*RemoveOptions) Validate ¶ added in v0.5.1
func (o *RemoveOptions) Validate() error
Validate checks that all user input is valid
type RenameOptions ¶ added in v0.5.0
type RenameOptions struct { ioes.IOStreams From string To string // contains filtered or unexported fields }
RenameOptions encapsulates state for the rename command
func (*RenameOptions) Complete ¶ added in v0.5.0
func (o *RenameOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*RenameOptions) Run ¶ added in v0.5.0
func (o *RenameOptions) Run() error
Run executes the rename command
func (*RenameOptions) Validate ¶ added in v0.5.1
func (o *RenameOptions) Validate() error
Validate checks that all user input is valid
type RenderOptions ¶ added in v0.5.0
type RenderOptions struct { ioes.IOStreams Refs *RefSelect Template string UseViz bool Output string // contains filtered or unexported fields }
RenderOptions encapsulates state for the render command
func (*RenderOptions) Complete ¶ added in v0.5.0
func (o *RenderOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*RenderOptions) Run ¶ added in v0.5.0
func (o *RenderOptions) Run() error
Run executes the render command
type RestoreOptions ¶ added in v0.9.0
type RestoreOptions struct { ioes.IOStreams Instance *lib.Instance Refs *RefSelect Version string Selector string }
RestoreOptions encapsulates state for the `restore` command
func (*RestoreOptions) Complete ¶ added in v0.9.0
func (o *RestoreOptions) Complete(f Factory, args []string) (err error)
Complete configures the restore command
func (*RestoreOptions) Run ¶ added in v0.9.0
func (o *RestoreOptions) Run() (err error)
Run executes the `restore` command
type SQLOptions ¶ added in v0.9.7
type SQLOptions struct { ioes.IOStreams Query string Format string Offline bool Instance *lib.Instance }
SQLOptions encapsulates state for the SQL command
func (*SQLOptions) Complete ¶ added in v0.9.7
func (o *SQLOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*SQLOptions) Run ¶ added in v0.9.7
func (o *SQLOptions) Run() (err error)
Run executes the search command
type SaveOptions ¶ added in v0.5.0
type SaveOptions struct { ioes.IOStreams Refs *RefSelect FilePaths []string BodyPath string Drop string Title string Message string Apply bool NoApply bool DeprecatedDryRun bool Secrets []string Replace bool ShowValidation bool KeepFormat bool Force bool NoRender bool NewName bool UseDscache bool // contains filtered or unexported fields }
SaveOptions encapsulates state for the save command
func (*SaveOptions) Complete ¶ added in v0.5.0
func (o *SaveOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*SaveOptions) Run ¶ added in v0.5.0
func (o *SaveOptions) Run() (err error)
Run executes the save command
func (*SaveOptions) Validate ¶ added in v0.5.1
func (o *SaveOptions) Validate() error
Validate checks that all user input is valid
type SearchOptions ¶ added in v0.5.0
type SearchOptions struct { ioes.IOStreams Query string Format string PageSize int Page int Instance *lib.Instance }
SearchOptions encapsulates state for the search command
func (*SearchOptions) Complete ¶ added in v0.5.0
func (o *SearchOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*SearchOptions) Run ¶ added in v0.5.0
func (o *SearchOptions) Run() (err error)
Run executes the search command
func (*SearchOptions) Validate ¶ added in v0.5.1
func (o *SearchOptions) Validate() error
Validate checks that any user inputs are valid
type SetupOptions ¶ added in v0.5.0
type SetupOptions struct { ioes.IOStreams Generator key.CryptoGenerator Anonymous bool Overwrite bool IPFS bool Remove bool Username string Registry string IPFSConfigData string ConfigData string GimmeDoggo bool // contains filtered or unexported fields }
SetupOptions encapsulates state for the setup command
func (*SetupOptions) Complete ¶ added in v0.5.0
func (o *SetupOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*SetupOptions) CreateAndDisplayDoggo ¶ added in v0.9.4
func (o *SetupOptions) CreateAndDisplayDoggo() error
CreateAndDisplayDoggo creates and display a doggo name
func (*SetupOptions) DoSetup ¶ added in v0.5.0
func (o *SetupOptions) DoSetup(f Factory) (err error)
DoSetup executes the setup-ie bit from the setup command
func (*SetupOptions) Run ¶ added in v0.5.0
func (o *SetupOptions) Run(f Factory) error
Run executes the setup command
type StatusOptions ¶ added in v0.9.0
StatusOptions encapsulates state for the Status command
func (*StatusOptions) Complete ¶ added in v0.9.0
func (o *StatusOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*StatusOptions) Run ¶ added in v0.9.0
func (o *StatusOptions) Run() (err error)
Run executes the status command
type UseOptions ¶ added in v0.5.0
type UseOptions struct { ioes.IOStreams Refs []string List bool Clear bool // contains filtered or unexported fields }
UseOptions encapsulates state for the search command
func (*UseOptions) Complete ¶ added in v0.5.0
func (o *UseOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*UseOptions) Run ¶ added in v0.5.0
func (o *UseOptions) Run() (err error)
Run executes the search command
func (*UseOptions) Validate ¶ added in v0.5.1
func (o *UseOptions) Validate() error
Validate checks that any user input is valide
type ValidateOptions ¶ added in v0.5.0
type ValidateOptions struct { ioes.IOStreams Refs *RefSelect BodyFilepath string SchemaFilepath string StructureFilepath string Format string // contains filtered or unexported fields }
ValidateOptions encapsulates state for the validate command
func (*ValidateOptions) Complete ¶ added in v0.5.0
func (o *ValidateOptions) Complete(f Factory, args []string) (err error)
Complete adds any configuration that can only be added just before calling Run
func (*ValidateOptions) Run ¶ added in v0.5.0
func (o *ValidateOptions) Run() (err error)
Run executes the run command
type WhatChangedOptions ¶ added in v0.9.7
WhatChangedOptions encapsulates state for the whatchanged command
func (*WhatChangedOptions) Complete ¶ added in v0.9.7
func (o *WhatChangedOptions) Complete(f Factory, args []string) (err error)
Complete adds any missing configuration that can only be added just before calling Run
func (*WhatChangedOptions) Run ¶ added in v0.9.7
func (o *WhatChangedOptions) Run() (err error)
Run executes the whatchanged command
Source Files ¶
- access.go
- apply.go
- checkout.go
- cmd.go
- completion.go
- config.go
- connect.go
- dag.go
- diff.go
- factory.go
- fsi.go
- get.go
- init.go
- list.go
- log.go
- peers.go
- preview.go
- print.go
- pull.go
- push.go
- qri.go
- ref_select.go
- registry.go
- remove.go
- rename.go
- render.go
- restore.go
- save.go
- search.go
- setup.go
- sql.go
- status.go
- stringers.go
- system.go
- templates.go
- use.go
- validate.go
- version.go
- whatchanged.go