Documentation
¶
Index ¶
- Variables
- func Confirm(msg string) bool
- func ConfirmContinue(target string, ids ...int64) bool
- func FlattenErrors(errors []error) error
- func FlattenErrorsWithPrefix(errors []error, pref string) error
- func GetParamTemplateValue(o InputOption) (string, error)
- func IsEmpty(object interface{}) bool
- func StringIDs(ids []int64) []string
- func UniqIDs(elements []int64) []int64
- func ValidateBetween(fieldName string, object interface{}, min int, max int) []error
- func ValidateConflictValues(fieldName string, object interface{}, values map[string]interface{}) []error
- func ValidateConflicts(fieldName string, object interface{}, values map[string]interface{}) []error
- func ValidateIPv4Address(fieldName string, object interface{}) []error
- func ValidateIPv6Address(fieldName string, object interface{}) []error
- func ValidateInStrValues(fieldName string, object interface{}, allowValues ...string) []error
- func ValidateInputOption(o InputOption) []error
- func ValidateOutputOption(o output.Option) []error
- func ValidateRequired(fieldName string, object interface{}) []error
- func ValidateSakuraID(fieldName string, object interface{}) []error
- func ValidateSetProhibited(fieldName string, object interface{}) []error
- type Context
- type FlagContext
- type InputOption
- type Option
- type OutputTypeHolder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultZone = "tk1a" DefaultOutputType = "table" )
View Source
var GlobalFlags = []cli.Flag{ &cli.StringFlag{ Name: "token", Usage: "API Token of SakuraCloud", EnvVars: []string{"SAKURACLOUD_ACCESS_TOKEN"}, DefaultText: "none", Destination: &GlobalOption.AccessToken, }, &cli.StringFlag{ Name: "secret", Usage: "API Secret of SakuraCloud", EnvVars: []string{"SAKURACLOUD_ACCESS_TOKEN_SECRET"}, DefaultText: "none", Destination: &GlobalOption.AccessTokenSecret, }, &cli.StringFlag{ Name: "zone", Usage: "Target zone of SakuraCloud", EnvVars: []string{"SAKURACLOUD_ZONE"}, Value: DefaultZone, DefaultText: DefaultZone, Destination: &GlobalOption.Zone, }, &cli.StringFlag{ Name: "config", Aliases: []string{"profile"}, Usage: "Config(Profile) name", EnvVars: []string{"USACLOUD_PROFILE"}, Destination: &GlobalOption.ProfileName, }, &cli.StringFlag{ Name: "api-root-url", Hidden: true, EnvVars: []string{"USACLOUD_API_ROOT_URL"}, Destination: &GlobalOption.APIRootURL, }, &cli.StringFlag{ Name: "default-output-type", EnvVars: []string{"USACLOUD_DEFAULT_OUTPUT_TYPE"}, Destination: &GlobalOption.DefaultOutputType, Value: DefaultOutputType, Hidden: true, }, &cli.StringSliceFlag{ Name: "zones", Hidden: true, }, &cli.BoolFlag{ Name: "trace", Usage: "Flag of SakuraCloud debug-mode", EnvVars: []string{"SAKURACLOUD_TRACE_MODE"}, Destination: &GlobalOption.TraceMode, Value: false, Hidden: true, }, }
View Source
var GlobalOption = &Option{ In: os.Stdin, Out: colorable.NewColorableStdout(), Progress: colorable.NewColorableStderr(), Err: colorable.NewColorableStderr(), }
Functions ¶
func ConfirmContinue ¶ added in v0.0.12
func FlattenErrors ¶ added in v0.0.12
func FlattenErrorsWithPrefix ¶ added in v0.0.12
func GetParamTemplateValue ¶ added in v0.0.12
func GetParamTemplateValue(o InputOption) (string, error)
func IsEmpty ¶ added in v0.0.12
func IsEmpty(object interface{}) bool
IsEmpty is copied from github.com/stretchr/testify/assert/assetions.go
func ValidateBetween ¶ added in v0.0.12
func ValidateConflictValues ¶ added in v0.0.12
func ValidateConflicts ¶ added in v0.0.12
func ValidateIPv4Address ¶ added in v0.3.0
func ValidateIPv6Address ¶ added in v0.3.0
func ValidateInStrValues ¶ added in v0.0.12
func ValidateInputOption ¶ added in v0.0.12
func ValidateInputOption(o InputOption) []error
func ValidateOutputOption ¶ added in v0.0.12
func ValidateRequired ¶ added in v0.0.12
func ValidateSakuraID ¶ added in v0.0.12
func ValidateSetProhibited ¶ added in v0.0.12
Types ¶
type Context ¶
type Context interface { GetOutput() output.Output GetAPIClient() *api.Client Args() []string NArgs() int FlagContext }
func NewContext ¶
func NewContext(flagContext FlagContext, args []string, formater interface{}) Context
type FlagContext ¶
type InputOption ¶ added in v0.0.12
type Option ¶
type OutputTypeHolder ¶ added in v0.6.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.