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 GetConfigFilePath() (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 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 ConfigFileValue
- type Context
- type FlagContext
- type InputOption
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var AllowZones = []string{"is1a", "is1b", "tk1a", "tk1v"}
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: "tk1a", DefaultText: "tk1a", Destination: &GlobalOption.Zone, }, &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 GetConfigFilePath ¶ added in v0.0.2
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 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 ConfigFileValue ¶ added in v0.0.2
func LoadConfigFile ¶ added in v0.0.2
func LoadConfigFile() (*ConfigFileValue, error)
func (*ConfigFileValue) IsEmpty ¶ added in v0.0.2
func (p *ConfigFileValue) IsEmpty() bool
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.