Documentation ¶
Index ¶
- Variables
- func CmdValidator(t *testing.T, subject *cobra.Command, nSubCommands int, flags []string)
- func DeploymentStatus(baseURL, projectID string) string
- func GenerateAliases(use string, extra ...string) []string
- type DeleteOpts
- type DownloaderOpts
- type GlobalOpts
- type ListOpts
- type MetricsOpts
- type OutputOpts
- 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) IsTerminal() bool
- func (opts *OutputOpts) Print(v interface{}) error
- type PerformanceAdvisorOpts
- type WatchOpts
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ErrMissingOrgID = fmt.Errorf(requiredF, flag.OrgID)
Functions ¶
func CmdValidator ¶ added in v1.5.0
CmdValidator helps validate a cobra.Command, verifying the number of sub commands and the flags that are being defined for it
func DeploymentStatus ¶ added in v1.0.0
func GenerateAliases ¶ added in v1.4.0
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.
Types ¶
type DeleteOpts ¶ added in v1.0.0
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 ¶ added in v1.0.0
func NewDeleteOpts(successMsg, failMsg string) *DeleteOpts
func (*DeleteOpts) Delete ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (opts *DeleteOpts) FailMessage() string
FailMessage gets the set fail message or the default value
func (*DeleteOpts) Prompt ¶ added in v1.0.0
func (opts *DeleteOpts) Prompt() error
Prompt confirms that the resource should be deleted
func (*DeleteOpts) SuccessMessage ¶ added in v1.0.0
func (opts *DeleteOpts) SuccessMessage() string
SuccessMessage gets the set success message or the default value
type DownloaderOpts ¶ added in v1.0.0
DownloaderOpts 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 (*DownloaderOpts) NewWriteCloser ¶ added in v1.0.0
func (opts *DownloaderOpts) NewWriteCloser() (io.WriteCloser, error)
NewWriteCloser creates a new file, if Force is false then don't allow to overwrite the file
type GlobalOpts ¶ added in v1.0.0
func (*GlobalOpts) ConfigOrgID ¶ added in v1.0.0
func (opts *GlobalOpts) ConfigOrgID() string
ConfigOrgID returns the organization id. If the id is empty, it caches it after querying config.
func (*GlobalOpts) ConfigProjectID ¶ added in v1.0.0
func (opts *GlobalOpts) ConfigProjectID() string
ConfigProjectID returns the project id. If the id is empty, it caches it after querying config.
func (*GlobalOpts) PreRunE ¶ added in v1.0.0
func (opts *GlobalOpts) PreRunE(cbs ...cmdOpt) error
PreRunE is a function to call before running the command, this will call any additional function pass as a callback
func (*GlobalOpts) ValidateOrgID ¶ added in v1.8.0
func (opts *GlobalOpts) ValidateOrgID() error
ValidateOrgID validates orgID
func (*GlobalOpts) ValidateProjectID ¶ added in v1.8.0
func (opts *GlobalOpts) ValidateProjectID() error
ValidateProjectID validates projectID
type ListOpts ¶ added in v1.0.0
func (*ListOpts) NewListOptions ¶ added in v1.0.0
func (opts *ListOpts) NewListOptions() *mongodbatlas.ListOptions
type MetricsOpts ¶ added in v1.0.0
type MetricsOpts struct { ListOpts Granularity string Period string Start string End string MeasurementType []string }
func (*MetricsOpts) NewProcessMetricsListOptions ¶ added in v1.0.0
func (opts *MetricsOpts) NewProcessMetricsListOptions() *atlas.ProcessMeasurementListOptions
type OutputOpts ¶ added in v1.4.1
func (*OutputOpts) ConfigOutput ¶ added in v1.4.1
func (opts *OutputOpts) ConfigOutput() string
ConfigOutput returns the output format. If the format is empty, it caches it after querying config.
func (*OutputOpts) ConfigWriter ¶ added in v1.4.1
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 ¶ added in v1.4.1
func (opts *OutputOpts) InitOutput(w io.Writer, t string) func() error
InitOutput allow to init the OutputOpts in a functional way
func (*OutputOpts) IsCygwinTerminal ¶ added in v1.4.1
func (opts *OutputOpts) IsCygwinTerminal() bool
IsCygwinTerminal returns true is the current file descriptor is cygwin
func (*OutputOpts) IsTerminal ¶ added in v1.4.1
func (opts *OutputOpts) IsTerminal() bool
IsTerminal returns true is the current file descriptor is TTY kind of terminal
func (*OutputOpts) Print ¶ added in v1.4.1
func (opts *OutputOpts) Print(v interface{}) error
Print will evaluate the defined format and try to parse it accordingly outputting to the set writer
type PerformanceAdvisorOpts ¶ added in v1.6.0
func (*PerformanceAdvisorOpts) Host ¶ added in v1.6.0
func (opts *PerformanceAdvisorOpts) Host() (string, error)
Host returns the correct processName or the hostId in accordance with the service
func (*PerformanceAdvisorOpts) MarkRequiredFlagsByService ¶ added in v1.6.0
func (opts *PerformanceAdvisorOpts) MarkRequiredFlagsByService(cmd *cobra.Command) func() error
MarkRequiredFlagsByService marks processName or hostId as required in accordance with the service
Atlas: processName is required
OM/CM: hostId is required
type WatchOpts ¶ added in v1.4.1
type WatchOpts struct { OutputOpts // contains filtered or unexported fields }