Documentation ¶
Index ¶
- func AddCalculateFlags(flagSet *flag.FlagSet) (*flags.StringArray, *flags.StringArray, *flags.StringArray, *flags.StringArray, ...)
- func FetchAndCalculateResourceIndex(randomSleepFlag *int, providerFlag *flags.StringArray, ...) (int, error)
- func GetNewResourceIndex(resourceID *string, indexTag *string, resources []*cloud.Resource) (int, error)
- type Calculate
- func (calculate *Calculate) GetDescription() string
- func (calculate *Calculate) GetFlagSet() *flag.FlagSet
- func (calculate *Calculate) GetHelpFlag() *bool
- func (calculate *Calculate) GetName() string
- func (calculate *Calculate) GetSubCommands() []cli.Command
- func (calculate *Calculate) Init(helpFlagName string, helpFlagDescription string)
- func (calculate *Calculate) Process()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCalculateFlags ¶
func AddCalculateFlags(flagSet *flag.FlagSet) (*flags.StringArray, *flags.StringArray, *flags.StringArray, *flags.StringArray, *string, *string, *int)
AddCalculateFlags returns the flags required to calculate a resource's index in the order:
id: The ID of the resource index tag: The index tag to filter the resource group using random sleep: The maximum random number of seconds to sleep before calculating the index
func FetchAndCalculateResourceIndex ¶
func FetchAndCalculateResourceIndex( randomSleepFlag *int, providerFlag *flags.StringArray, regionFlag *flags.StringArray, typeFlag *flags.StringArray, tagFlag *flags.StringArray, idFlag *string, indexTagFlag *string) (int, error)
func GetNewResourceIndex ¶
func GetNewResourceIndex( resourceID *string, indexTag *string, resources []*cloud.Resource) (int, error)
GetNewResourceIndex calculates the new index for the resource with the ID specified in resourceID. An error will be returned if:
- No resource with the ID specified in resourceID is found in resourceMap
- The new index is not different from the current index of the resource
Types ¶
type Calculate ¶
type Calculate struct {
// contains filtered or unexported fields
}
Calculate determines whether a resource needs a new index. Exit codes are:
0 - If the resource needs a new index (proposed index is returned) 1 - If a command execution error occurs 2 - If a command processing error occurs (e.g if an unavailable flag is provided by the user) 3 - If the resource doesn't need a new index (whatever index it has right now is just fine)
func (*Calculate) GetDescription ¶
GetDescription returns the description for the calculate command
func (*Calculate) GetFlagSet ¶
GetFlagSet returns a pointer to the flag.FlagSet associated to the command
func (*Calculate) GetHelpFlag ¶
GetHelpFlag returns a pointer to the initialized help flag for the command
func (*Calculate) GetSubCommands ¶
GetSubCommands returns a slice of subcommands under the calculate command (expect empty slice if none)
Click to show internal directories.
Click to hide internal directories.