Documentation
¶
Index ¶
- Variables
- func GenerateAliases(use string, extra ...string) []string
- func ReturnValueForSetting(enableFlag, disableFlag bool) *bool
- type AutoFunc
- type DeleteOpts
- type GlobalOpts
- type OutputOpts
- func (*OutputOpts) AutoCompleteOutputFlag() ...
- func (opts *OutputOpts) ConfigOutput() string
- func (opts *OutputOpts) ConfigWriter() io.Writer
- func (opts *OutputOpts) InitOutput(w io.Writer, t string) func() error
- func (opts *OutputOpts) IsCygwinTerminal() bool
- func (opts *OutputOpts) IsGoTemplate() bool
- func (opts *OutputOpts) IsJSONOutput() bool
- func (opts *OutputOpts) IsJSONPathOutput() bool
- func (opts *OutputOpts) IsPlainOutput() bool
- func (opts *OutputOpts) IsTerminal() bool
- func (opts *OutputOpts) Print(o interface{}) error
- func (opts *OutputOpts) PrintForCompactResultsResponse(o interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ErrFreeClusterAlreadyExists = errors.New("this project already has another free cluster. To learn how to create non-free clusters, run \"atlas cluster create --help\"")
var ErrMissingOrgID = fmt.Errorf(requiredF, flag.OrgID)
var ErrNameExists = errors.New(`the name already exists. Please run "atlas cluster list" to review existing cluster names`)
var ErrNoRegionExistsTryCommand = errors.New(`the region does not exist. To find the available regions, run "atlas cluster availableRegions list"`)
Functions ¶
func GenerateAliases ¶
GenerateAliases return aliases for use such that they are: a version all lower case, a version with dashes, a singular versions with the same rules.
func ReturnValueForSetting ¶
ReturnValueForSetting returns a boolean value that is useful when working with boolean flags to inform whether the given option should be active or inactive.
Types ¶
type DeleteOpts ¶
DeleteOpts options required when deleting a resource. A command can compose this struct and then safely rely on the methods Prompt, or Delete to manage the interactions with the user.
func NewDeleteOpts ¶
func NewDeleteOpts(successMsg, failMsg string) *DeleteOpts
func (*DeleteOpts) Delete ¶
func (opts *DeleteOpts) Delete(d interface{}, a ...string) error
Delete deletes a resource not associated to a project, it expects a callback that should perform the deletion from the store.
func (*DeleteOpts) FailMessage ¶
func (opts *DeleteOpts) FailMessage() string
FailMessage gets the set fail message or the default value.
func (*DeleteOpts) Prompt ¶
func (opts *DeleteOpts) Prompt() error
Prompt confirms that the resource should be deleted.
func (*DeleteOpts) PromptWithMessage ¶
func (opts *DeleteOpts) PromptWithMessage(message string) error
PromptWithMessage confirms that the resource should be deleted.
func (*DeleteOpts) SuccessMessage ¶
func (opts *DeleteOpts) SuccessMessage() string
SuccessMessage gets the set success message or the default value.
type GlobalOpts ¶
func (*GlobalOpts) ConfigOrgID ¶
func (opts *GlobalOpts) ConfigOrgID() string
ConfigOrgID returns the organization id. If the id is empty, it caches it after querying config.
func (*GlobalOpts) ConfigProjectID ¶
func (opts *GlobalOpts) ConfigProjectID() string
ConfigProjectID returns the project id. If the id is empty, it caches it after querying config.
func (*GlobalOpts) ValidateOrgID ¶
func (opts *GlobalOpts) ValidateOrgID() error
ValidateOrgID validates orgID.
func (*GlobalOpts) ValidateProjectID ¶
func (opts *GlobalOpts) ValidateProjectID() error
ValidateProjectID validates projectID.
type OutputOpts ¶
func (*OutputOpts) AutoCompleteOutputFlag ¶
func (*OutputOpts) AutoCompleteOutputFlag() func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
func (*OutputOpts) ConfigOutput ¶
func (opts *OutputOpts) ConfigOutput() string
ConfigOutput returns the output format. If the format is empty, it caches it after querying config.
func (*OutputOpts) ConfigWriter ¶
func (opts *OutputOpts) ConfigWriter() io.Writer
ConfigWriter returns the io.Writer. If the writer is nil, it defaults to os.Stdout and caches it.
func (*OutputOpts) InitOutput ¶
func (opts *OutputOpts) InitOutput(w io.Writer, t string) func() error
InitOutput allow to init the OutputOpts in a functional way.
func (*OutputOpts) IsCygwinTerminal ¶
func (opts *OutputOpts) IsCygwinTerminal() bool
IsCygwinTerminal returns true is the current file descriptor is cygwin.
func (*OutputOpts) IsGoTemplate ¶
func (opts *OutputOpts) IsGoTemplate() bool
func (*OutputOpts) IsJSONOutput ¶
func (opts *OutputOpts) IsJSONOutput() bool
func (*OutputOpts) IsJSONPathOutput ¶
func (opts *OutputOpts) IsJSONPathOutput() bool
func (*OutputOpts) IsPlainOutput ¶
func (opts *OutputOpts) IsPlainOutput() bool
func (*OutputOpts) IsTerminal ¶
func (opts *OutputOpts) IsTerminal() bool
IsTerminal returns true is the current file descriptor is TTY kind of terminal.
func (*OutputOpts) Print ¶
func (opts *OutputOpts) Print(o interface{}) error
Print will evaluate the defined format and try to parse it accordingly outputting to the set writer.
func (*OutputOpts) PrintForCompactResultsResponse ¶
func (opts *OutputOpts) PrintForCompactResultsResponse(o interface{}) error