Documentation ¶
Index ¶
- Variables
- func AskBool(question string, defaultAnswer string) bool
- func ConfirmDeletion(what string, deletableItems []string) error
- func DumpData(format string, data interface{}) error
- func NewClient() (client.Client, error)
- func PrintResources(resources map[string][]string)
- func SetAssetsPath(path string) error
- func ShowProgressBar(ctx context.Context, summary string, max float64, sent chan float64, ...) error
- func ShowProgressSpin(ctx context.Context, summary string, op func(ctx context.Context) error) error
- type RemoteActivateCmd
- type RemoteAddCmd
- type RemoteCommand
- type RemoteListCmd
- type RemoteRemoveCmd
- type RemoteSetURLCmd
- type RemotesCfg
Constants ¶
This section is empty.
Variables ¶
var ErrAssetsPathNotSet = errors.New("Assets path is not set")
ErrAssetsPathNotSet reported error when tried to use the cli tool before setting a local assets path
var ( // ErrEmptyRemotesCfgPath returned when tried to access remotes config permament storage // before providing a path for it ErrEmptyRemotesCfgPath = errors.New("Remotes configuration file path is not set") )
Functions ¶
func ConfirmDeletion ¶
ConfirmDeletion prints out a question about removing resources and returns error if 'yes' is not replied
func PrintResources ¶
PrintResources prints out a list of resources, in a well formatted list one per row and padded
func SetAssetsPath ¶
SetAssetsPath sets the local path to store cli tool configuration files, certificates an any needed stuff. Triggers the initial configuration setup
func ShowProgressBar ¶
func ShowProgressBar(ctx context.Context, summary string, max float64, sent chan float64, op func(ctx context.Context) error) error
ShowProgressBar prints out a progress bar in console while op function is being executed. A 'max' value and 'sent' channel parameters are needed to visually progress the bar
Types ¶
type RemoteActivateCmd ¶
type RemoteActivateCmd struct { Args struct { Name string `positional-arg-name:"name"` } `positional-args:"yes" required:"yes"` }
RemoteActivateCmd sets the remote endpoint to use from this client
func (*RemoteActivateCmd) Execute ¶
func (cmd *RemoteActivateCmd) Execute(args []string) error
Execute sets the active remote
type RemoteAddCmd ¶
type RemoteAddCmd struct { Args struct { Name string `positional-arg-name:"name" required:"yes"` URL string `positional-arg-name:"url" required:"yes"` } `positional-args:"yes"` AcceptCertificate bool `long:"accept-certificate" description:"Implicit accepts remote server certificate if https"` }
RemoteAddCmd adds a new remote
func (*RemoteAddCmd) Execute ¶
func (cmd *RemoteAddCmd) Execute(args []string) error
Execute adds a new remote
type RemoteCommand ¶
type RemoteCommand struct { List RemoteListCmd `command:"list" alias:"ls" description:"List available remotes"` Add RemoteAddCmd `command:"add" description:"Add a new remote"` Remove RemoteRemoveCmd `command:"remove" description:"Remove a remote"` Activate RemoteActivateCmd `command:"activate" description:"Set active remote"` SetURL RemoteSetURLCmd `command:"set-url" description:"Set url of an existing remote"` }
RemoteCommand is the command for AMS remote management
type RemoteListCmd ¶
type RemoteListCmd struct {
Format string `long:"format" description:"Output format (table|json)" default:"table"`
}
RemoteListCmd lists available remotes
func (*RemoteListCmd) Execute ¶
func (cmd *RemoteListCmd) Execute(args []string) error
Execute lists all currently configured remotes
type RemoteRemoveCmd ¶
type RemoteRemoveCmd struct { Args struct { Name string `positional-arg-name:"name"` } `positional-args:"yes" required:"yes"` }
RemoteRemoveCmd removes an existing remote
func (*RemoteRemoveCmd) Execute ¶
func (cmd *RemoteRemoveCmd) Execute(args []string) error
Execute removes an existing remote
type RemoteSetURLCmd ¶
type RemoteSetURLCmd struct { Args struct { Name string `positional-arg-name:"name"` URL string `positional-arg-name:"url"` } `positional-args:"yes" required:"yes"` }
RemoteSetURLCmd sets the URL of a existing remote
func (*RemoteSetURLCmd) Execute ¶
func (cmd *RemoteSetURLCmd) Execute(args []string) error
Execute sets the URL of a existing remote
type RemotesCfg ¶
type RemotesCfg struct { Active string `yaml:"default-remote,omitempty"` Availables map[string]string `yaml:"remotes,omitempty"` // contains filtered or unexported fields }
RemotesCfg contains the remotes configuration