cmd

package
v0.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: GPL-3.0 Imports: 42 Imported by: 1

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 refering 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

View Source
const ColumnPositionForMtime = 40

ColumnPositionForMtime is the column position at which to display mod times, if requested

View Source
const FileSelectedRefs = "/selected_refs.json"

FileSelectedRefs stores selection, is copied from github.com/qri-io/qri/repo/fs/files.go

Variables

This section is empty.

Functions

func DefaultSelectedRefList added in v0.9.0

func DefaultSelectedRefList(f Factory) ([]string, error)

DefaultSelectedRefList returns the list of currently `use`ing dataset references

func EnvPathFactory added in v0.5.0

func EnvPathFactory() (string, string)

EnvPathFactory returns qri & IPFS paths based on enviornment variables falling back to $HOME/.qri && $HOME/.ipfs

func ErrExit

func ErrExit(w io.Writer, err error)

ErrExit writes an error to the given io.Writer & exits

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 ExitIfErr

func ExitIfErr(w io.Writer, err error)

ExitIfErr only calls ErrExit if there is an error present

func GetWd

func GetWd() string

GetWd is a convenience method to get the working directory or bail.

func NewAddCommand added in v0.5.0

func NewAddCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewAddCommand creates an add command

func NewCheckoutCommand added in v0.9.0

func NewCheckoutCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

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

func NewConfigCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewConfigCommand creates a new `qri config` cobra command config represents commands that read & modify configuration settings

func NewConnectCommand added in v0.5.0

func NewConnectCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewConnectCommand creates a new `qri connect` cobra command for connecting to the d.web, local api, rpc server, and webapp

func NewDAGCommand added in v0.7.3

func NewDAGCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

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

func NewDiffCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewDiffCommand creates a new `qri diff` cobra command for comparing changes between datasets

func NewExportCommand added in v0.5.0

func NewExportCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewExportCommand creates a new export cobra command exportCmd represents the export command

func NewFSICommand added in v0.9.0

func NewFSICommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewFSICommand creates a new `qri fsi` command for working with file system integration

func NewGetCommand added in v0.5.0

func NewGetCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewGetCommand creates a new `qri search` command that searches for datasets

func NewInitCommand added in v0.9.0

func NewInitCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

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

func NewListCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewListCommand creates new `qri list` command that lists datasets for the local peer & others

func NewLogCommand added in v0.5.0

func NewLogCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewLogCommand creates a new `qri log` cobra command

func NewPeersCommand added in v0.5.0

func NewPeersCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewPeersCommand cerates a new `qri peers` cobra command

func NewPublishCommand added in v0.6.0

func NewPublishCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewPublishCommand creates a `qri publish` subcommand for working with configured registries

func NewQriCommand added in v0.5.0

func NewQriCommand(ctx context.Context, pf PathFactory, generator gen.CryptoGenerator, ioStreams ioes.IOStreams) *cobra.Command

NewQriCommand represents the base command when called without any subcommands

func NewRegistryCommand added in v0.5.0

func NewRegistryCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewRegistryCommand creates a `qri registry` subcommand for working with configured registries TODO - registry command is currently removed in favor of the newer "qri publish" command we should consider refactoring this code (espcially it's documentation) & use it for registry-specific publication & search interaction

func NewRemoveCommand added in v0.5.0

func NewRemoveCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewRemoveCommand creates a new `qri remove` cobra command for removing datasets from a local repository

func NewRenameCommand added in v0.5.0

func NewRenameCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewRenameCommand creates a new `qri rename` cobra command for renaming datasets

func NewRenderCommand added in v0.5.0

func NewRenderCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewRenderCommand creates a new `qri render` command for executing templates against datasets

func NewRestoreCommand added in v0.9.0

func NewRestoreCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewRestoreCommand creates new `qri restore` command

func NewSaveCommand added in v0.5.0

func NewSaveCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewSaveCommand creates a `qri save` cobra command used for saving changes to datasets

func NewSearchCommand added in v0.5.0

func NewSearchCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewSearchCommand creates a new `qri search` command that searches for datasets

func NewSetupCommand added in v0.5.0

func NewSetupCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewSetupCommand creates a setup command

func NewStatusCommand added in v0.9.0

func NewStatusCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewStatusCommand creates a `qri status` command that compares working directory to prev version

func NewUpdateCommand added in v0.6.0

func NewUpdateCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewUpdateCommand creates a new `qri update` cobra command for updating datasets

func NewUseCommand added in v0.5.0

func NewUseCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewUseCommand creates a new `qri search` command that searches for datasets

func NewValidateCommand added in v0.5.0

func NewValidateCommand(f Factory, ioStreams ioes.IOStreams) *cobra.Command

NewValidateCommand creates a new `qri validate` cobra command for showing schema errors in a dataset body

func NewVersionCommand added in v0.5.0

func NewVersionCommand(_ Factory, ioStreams ioes.IOStreams) *cobra.Command

NewVersionCommand creates a new `qri version` cobra command that prints the current qri version

func QRIRepoInitialized

func QRIRepoInitialized(path string) bool

QRIRepoInitialized checks to see if a repository has been initialized at $QRI_PATH

Types

type AddOptions added in v0.5.0

type AddOptions struct {
	ioes.IOStreams
	DatasetRequests *lib.DatasetRequests
}

AddOptions encapsulates state for the add command

func (*AddOptions) Complete added in v0.5.0

func (o *AddOptions) Complete(f Factory) (err error)

Complete adds any missing configuration that can only be added just before calling Run

func (*AddOptions) Run added in v0.5.0

func (o *AddOptions) Run(args []string) error

Run adds another peer's dataset to this user's repo

type CheckoutOptions added in v0.9.0

type CheckoutOptions struct {
	ioes.IOStreams

	Refs *RefSelect

	FSIMethods *lib.FSIMethods
}

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

	ConfigMethods  *lib.ConfigMethods
	ProfileMethods *lib.ProfileMethods
	// 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) Get added in v0.5.0

func (o *ConfigOptions) Get(args []string) (err error)

Get a configuration option

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() (err 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

	DatasetRequests *lib.DatasetRequests
}

DAGOptions encapsulates state for the dag command

func (*DAGOptions) Complete added in v0.7.3

func (o *DAGOptions) Complete(f Factory, args []string) (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 manigest 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

	DatasetRequests *lib.DatasetRequests
}

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

func (*DiffOptions) RunLinkedFilesys added in v0.9.0

func (o *DiffOptions) RunLinkedFilesys(p *lib.DiffParams) (err error)

RunLinkedFilesys executes diff against a linked directory

type ExportOptions added in v0.5.0

type ExportOptions struct {
	ioes.IOStreams

	Refs   *RefSelect
	Blank  bool
	Output string
	Format string
	Zipped bool

	UsingRPC       bool
	ExportRequests *lib.ExportRequests
}

ExportOptions encapsulates state for the export command

func (*ExportOptions) Complete added in v0.5.0

func (o *ExportOptions) Complete(f Factory, args []string) (err error)

Complete adds any missing configuration that can only be added just before calling Run

func (*ExportOptions) Run added in v0.5.0

func (o *ExportOptions) Run() error

Run executes the Export command

type FSIOptions added in v0.9.0

type FSIOptions struct {
	ioes.IOStreams

	Refs       *RefSelect
	FSIMethods *lib.FSIMethods
}

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 (o *FSIOptions) Link() (err error)

Link creates a FSI link

func (o *FSIOptions) Unlink() error

Unlink executes the fsi unlink command

type Factory added in v0.5.0

type Factory interface {
	Instance() *lib.Instance
	Config() (*config.Config, error)

	IpfsFsPath() string
	QriRepoPath() string
	CryptoGenerator() gen.CryptoGenerator

	Init() error
	RPC() *rpc.Client
	ConnectionNode() (*p2p.QriNode, error)

	ConfigMethods() (*lib.ConfigMethods, error)
	DatasetRequests() (*lib.DatasetRequests, error)
	RemoteMethods() (*lib.RemoteMethods, error)
	RegistryClientMethods() (*lib.RegistryClientMethods, error)
	LogRequests() (*lib.LogRequests, error)
	ExportRequests() (*lib.ExportRequests, error)
	PeerRequests() (*lib.PeerRequests, error)
	ProfileMethods() (*lib.ProfileMethods, error)
	SearchMethods() (*lib.SearchMethods, error)
	RenderRequests() (*lib.RenderRequests, error)
	FSIMethods() (*lib.FSIMethods, 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
	HasPretty bool

	DatasetRequests *lib.DatasetRequests
}

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

	Name   string
	Format string

	DatasetRequests *lib.DatasetRequests
	FSIMethods      *lib.FSIMethods
}

InitOptions encapsulates state for the `init` command

func (*InitOptions) Complete added in v0.9.0

func (o *InitOptions) Complete(f Factory) (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
	Peername        string
	Published       bool
	ShowNumVersions bool

	DatasetRequests *lib.DatasetRequests
}

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

	LogRequests *lib.LogRequests
}

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 PathFactory added in v0.5.0

type PathFactory func() (string, string)

PathFactory is a function that returns paths to qri & ipfs repos

func NewDirPathFactory added in v0.5.0

func NewDirPathFactory(dir string) PathFactory

NewDirPathFactory creates a path factory that sets qri & ipfs paths to dir/qri & qri/ipfs

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
	PeerRequests *lib.PeerRequests
}

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 PublishOptions added in v0.6.0

type PublishOptions struct {
	ioes.IOStreams

	Refs       []string
	Unpublish  bool
	NoRegistry bool
	NoPin      bool
	RemoteName string

	DatasetRequests *lib.DatasetRequests
	RemoteMethods   *lib.RemoteMethods
}

PublishOptions encapsulates state for the publish command

func (*PublishOptions) Complete added in v0.6.0

func (o *PublishOptions) Complete(f Factory, args []string) (err error)

Complete adds any missing configuration that can only be added just before calling Run

func (*PublishOptions) Run added in v0.6.0

func (o *PublishOptions) Run() error

Run executes the publish command

type QriOptions added in v0.5.0

type QriOptions struct {
	ioes.IOStreams

	// path to the QRI repository directory
	RepoPath string
	// custom path to IPFS repo
	IpfsPath string

	// NoPrompt Disables all promt messages
	NoPrompt bool
	// NoColor disables colorized output
	NoColor bool
	// path to configuration object
	ConfigPath string
	// contains filtered or unexported fields
}

QriOptions holds the Root Command State

func NewQriOptions added in v0.5.0

func NewQriOptions(ctx context.Context, qriPath, ipfsPath string, generator gen.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) ConfigMethods added in v0.8.0

func (o *QriOptions) ConfigMethods() (m *lib.ConfigMethods, err error)

ConfigMethods generates a lib.ConfigMethods 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() gen.CryptoGenerator

CryptoGenerator returns a resource for generating cryptographic info

func (*QriOptions) DatasetRequests added in v0.5.0

func (o *QriOptions) DatasetRequests() (*lib.DatasetRequests, error)

DatasetRequests generates a lib.DatasetRequests from internal state

func (*QriOptions) ExportRequests added in v0.6.2

func (o *QriOptions) ExportRequests() (*lib.ExportRequests, error)

ExportRequests generates a lib.ExportRequests from internal state

func (*QriOptions) FSIMethods added in v0.9.0

func (o *QriOptions) FSIMethods() (m *lib.FSIMethods, err error)

FSIMethods generates a lib.FSIMethods from internal state

func (*QriOptions) Init added in v0.6.2

func (o *QriOptions) Init() (err error)

Init will initialize the internal state

func (*QriOptions) Instance added in v0.8.0

func (o *QriOptions) Instance() *lib.Instance

Instance returns the instance this options is using

func (*QriOptions) IpfsFsPath added in v0.5.0

func (o *QriOptions) IpfsFsPath() string

IpfsFsPath returns from internal state

func (*QriOptions) LogRequests added in v0.5.2

func (o *QriOptions) LogRequests() (*lib.LogRequests, error)

LogRequests generates a lib.LogRequests from internal state

func (*QriOptions) PeerRequests added in v0.5.0

func (o *QriOptions) PeerRequests() (*lib.PeerRequests, error)

PeerRequests generates a lib.PeerRequests from internal state

func (*QriOptions) ProfileMethods added in v0.8.0

func (o *QriOptions) ProfileMethods() (m *lib.ProfileMethods, err error)

ProfileMethods generates a lib.ProfileMethods from internal state

func (*QriOptions) QriRepoPath added in v0.5.0

func (o *QriOptions) QriRepoPath() string

QriRepoPath returns from internal state

func (*QriOptions) RPC added in v0.5.0

func (o *QriOptions) RPC() *rpc.Client

RPC returns from internal state

func (*QriOptions) RegistryClientMethods added in v0.9.0

func (o *QriOptions) RegistryClientMethods() (*lib.RegistryClientMethods, error)

RegistryClientMethods generates a lib.RegistryClientMethods from internal state

func (*QriOptions) RemoteMethods added in v0.9.0

func (o *QriOptions) RemoteMethods() (*lib.RemoteMethods, error)

RemoteMethods generates a lib.RemoteMethods from internal state

func (*QriOptions) RenderRequests added in v0.5.0

func (o *QriOptions) RenderRequests() (*lib.RenderRequests, error)

RenderRequests generates a lib.RenderRequests from internal state

func (*QriOptions) SearchMethods added in v0.9.0

func (o *QriOptions) SearchMethods() (*lib.SearchMethods, error)

SearchMethods generates a lib.SearchMethods from internal state

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) (*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 precendence, from most important to least. This is the recommended method for command-line commands to get references, unless they have a special way of interacting with datasets (for example, `qri status`).

func GetLinkedRefSelect added in v0.9.0

func GetLinkedRefSelect() (*RefSelect, error)

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

func NewExplicitRefSelect(ref string) *RefSelect

NewExplicitRefSelect returns a single explicitly provided reference

func NewLinkedDirectoryRefSelect added in v0.9.0

func NewLinkedDirectoryRefSelect(ref, dir string) *RefSelect

NewLinkedDirectoryRefSelect returns a single reference implied by a linked directory

func NewListOfRefSelects added in v0.9.0

func NewListOfRefSelects(refs []string) *RefSelect

NewListOfRefSelects returns a list of explicitly provided references

func NewUsingRefSelect added in v0.9.0

func NewUsingRefSelect(ref string) *RefSelect

NewUsingRefSelect returns a single reference implied by the use command

func (*RefSelect) Dir added in v0.9.0

func (r *RefSelect) Dir() string

Dir returns the directory of a linked directory reference

func (*RefSelect) IsExplicit added in v0.9.0

func (r *RefSelect) IsExplicit() bool

IsExplicit returns whether the reference is explicit

func (*RefSelect) IsLinked added in v0.9.0

func (r *RefSelect) IsLinked() bool

IsLinked returns whether the reference is implied by a linked directory

func (*RefSelect) Ref added in v0.9.0

func (r *RefSelect) Ref() string

Ref returns the reference as a string

func (*RefSelect) RefList added in v0.9.0

func (r *RefSelect) RefList() []string

RefList returns a list of all references

func (*RefSelect) String added in v0.9.0

func (r *RefSelect) String() string

String returns a stringified version of the ref selection

type RegistryOptions added in v0.5.0

type RegistryOptions struct {
	ioes.IOStreams
	Refs                  []string
	RegistryClientMethods *lib.RegistryClientMethods
}

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

type RemoveOptions added in v0.5.0

type RemoveOptions struct {
	ioes.IOStreams

	Args []string

	RevisionsText string
	All           bool
	Revision      rev.Rev

	DatasetRequests *lib.DatasetRequests
}

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) 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

	DatasetRequests *lib.DatasetRequests
}

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
	Output   string

	RenderRequests *lib.RenderRequests
}

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() (err error)

Run executes the render command

type RestoreOptions added in v0.9.0

type RestoreOptions struct {
	ioes.IOStreams

	Refs          *RefSelect
	Path          string
	ComponentName string

	FSIMethods *lib.FSIMethods
}

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 SaveOptions added in v0.5.0

type SaveOptions struct {
	ioes.IOStreams

	Refs      *RefSelect
	FilePaths []string
	BodyPath  string
	Recall    string

	Title   string
	Message string

	UsingFSI       bool
	Replace        bool
	ShowValidation bool
	Publish        bool
	DryRun         bool
	KeepFormat     bool
	Force          bool
	NoRender       bool
	Secrets        []string

	DatasetRequests *lib.DatasetRequests
	FSIMethods      *lib.FSIMethods
}

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

	SearchMethods *lib.SearchMethods
}

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

	Anonymous      bool
	Overwrite      bool
	IPFS           bool
	Remove         bool
	Peername       string
	Registry       string
	IPFSConfigData string
	ConfigData     string

	QriRepoPath string
	IpfsFsPath  string
	Generator   gen.CryptoGenerator
}

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) 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

type StatusOptions struct {
	ioes.IOStreams

	Refs      *RefSelect
	ShowMtime bool

	FSIMethods *lib.FSIMethods
}

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

func (*StatusOptions) RunAtVersion added in v0.9.0

func (o *StatusOptions) RunAtVersion() (err error)

RunAtVersion displays status for a reference at a specific version

type UpdateOptions added in v0.6.0

type UpdateOptions struct {
	ioes.IOStreams

	Ref     string
	Title   string
	Message string

	BodyPath  string
	FilePaths []string
	Recall    string

	Publish    bool
	DryRun     bool
	NoRender   bool
	Force      bool
	KeepFormat bool
	Secrets    []string

	Daemonize bool
	Page      int
	PageSize  int

	// specifies custom repo location when scheduling a job,
	// should only be set if --repo persistent flag is set
	RepoPath string
	// contains filtered or unexported fields
}

UpdateOptions encapsulates state for the update command

func (*UpdateOptions) Complete added in v0.6.0

func (o *UpdateOptions) Complete(f Factory, args []string) (err error)

Complete adds any missing configuration that can only be added just before calling Run

func (*UpdateOptions) List added in v0.8.0

func (o *UpdateOptions) List() (err error)

List shows scheduled update jobs

func (*UpdateOptions) LogFile added in v0.8.0

func (o *UpdateOptions) LogFile(logName string) error

LogFile prints a log output file

func (*UpdateOptions) Logs added in v0.8.0

func (o *UpdateOptions) Logs(args []string) (err error)

Logs shows a history of job events

func (*UpdateOptions) RunUpdate added in v0.8.0

func (o *UpdateOptions) RunUpdate(args []string) (err error)

RunUpdate executes an update immediately

func (*UpdateOptions) Schedule added in v0.8.0

func (o *UpdateOptions) Schedule(args []string) (err error)

Schedule adds a job to the update scheduler

func (*UpdateOptions) ServiceStart added in v0.8.0

func (o *UpdateOptions) ServiceStart(ioStreams ioes.IOStreams, repoPath string) (err error)

ServiceStart ensures the update service is running

func (*UpdateOptions) ServiceStatus added in v0.8.0

func (o *UpdateOptions) ServiceStatus() error

ServiceStatus gets the current status of the update daemon

func (*UpdateOptions) ServiceStop added in v0.8.0

func (o *UpdateOptions) ServiceStop() (err error)

ServiceStop halts the update scheduler service

func (*UpdateOptions) Unschedule added in v0.8.0

func (o *UpdateOptions) Unschedule(args []string) (err error)

Unschedule removes a job from the scheduler

type UseOptions added in v0.5.0

type UseOptions struct {
	ioes.IOStreams

	Refs  []string
	List  bool
	Clear bool

	QriRepoPath string
}

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
	URL            string

	DatasetRequests *lib.DatasetRequests
}

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

Directories

Path Synopsis
Package generate is a command that creates a bash completion file for qri
Package generate is a command that creates a bash completion file for qri

Jump to

Keyboard shortcuts

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