Documentation ¶
Index ¶
- Variables
- type Command
- type CommandOption
- func (co *CommandOption[OPT]) RawRun(suffix string, desc string, cb func(ICloudProvider, *OPT) error)
- func (co *CommandOption[OPT]) RequireHost() *CommandOption[OPT]
- func (co *CommandOption[OPT]) RequireRegion() *CommandOption[OPT]
- func (co *CommandOption[OPT]) RequireZone() *CommandOption[OPT]
- func (co *CommandOption[OPT]) Run(suffix string, desc string, cb func(ICloudProvider, *OPT) (any, error))
- func (co *CommandOption[OPT]) RunByHost(suffix string, desc string, ...)
- func (co *CommandOption[OPT]) RunByProvider(suffix string, desc string, ...)
- func (co *CommandOption[OPT]) RunByRegion(suffix string, desc string, ...)
- func (co *CommandOption[OPT]) RunByZone(suffix string, desc string, ...)
- func (co *CommandOption[OPT]) UseGetterList() *CommandOption[OPT]
- func (co *CommandOption[OPT]) UseList() *CommandOption[OPT]
- type EmptyOption
- type GlobalOptions
- type HostBaseOptions
- type ICloudProvider
- type IHostBaseOptions
- type IListOption
- type IRunner
- func HostR[O IHostBaseOptions](cmd *Command) IRunner[O, cloudprovider.ICloudHost]
- func ProviderR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudProvider]
- func RegionR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudRegion]
- func ZoneR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudZone]
- type IZoneBaseOptions
- type ListBaseOptions
- type ObjectHeaderOptions
- type SEmptyOptionRunner
- func EmptyOptionProviderR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudProvider]
- func EmptyOptionRegionR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudRegion]
- func EmptyOptionRunner[C any](prefix string, rf func(*Command) IRunner[EmptyOption, C]) *SEmptyOptionRunner[C]
- func EmptyOptionZoneR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudZone]
- type ZoneBaseOptions
- type ZoneListOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CommandTable = &shellutils.CommandTable R = shellutils.R PrintList = printutils.PrintInterfaceList PrintObject = printutils.PrintInterfaceObject PrintGetterList = printutils.PrintGetterList )
Functions ¶
This section is empty.
Types ¶
type CommandOption ¶
func NewCO ¶
func NewCO[OPT any](cmd *Command) *CommandOption[OPT]
NewCO returns a Command with Option
func (*CommandOption[OPT]) RawRun ¶
func (co *CommandOption[OPT]) RawRun(suffix string, desc string, cb func(ICloudProvider, *OPT) error)
func (*CommandOption[OPT]) RequireHost ¶
func (co *CommandOption[OPT]) RequireHost() *CommandOption[OPT]
func (*CommandOption[OPT]) RequireRegion ¶
func (co *CommandOption[OPT]) RequireRegion() *CommandOption[OPT]
func (*CommandOption[OPT]) RequireZone ¶
func (co *CommandOption[OPT]) RequireZone() *CommandOption[OPT]
func (*CommandOption[OPT]) Run ¶
func (co *CommandOption[OPT]) Run(suffix string, desc string, cb func(ICloudProvider, *OPT) (any, error))
func (*CommandOption[OPT]) RunByHost ¶
func (co *CommandOption[OPT]) RunByHost( suffix string, desc string, cb func(cloudprovider.ICloudHost, *OPT) (any, error), )
func (*CommandOption[OPT]) RunByProvider ¶
func (co *CommandOption[OPT]) RunByProvider(suffix string, desc string, cb func(cloudprovider.ICloudProvider, *OPT) (any, error))
func (*CommandOption[OPT]) RunByRegion ¶
func (co *CommandOption[OPT]) RunByRegion( suffix string, desc string, cb func(cli cloudprovider.ICloudRegion, args *OPT) (any, error), )
func (*CommandOption[OPT]) RunByZone ¶
func (co *CommandOption[OPT]) RunByZone( suffix string, desc string, cb func(cloudprovider.ICloudZone, *OPT) (any, error), )
func (*CommandOption[OPT]) UseGetterList ¶
func (co *CommandOption[OPT]) UseGetterList() *CommandOption[OPT]
func (*CommandOption[OPT]) UseList ¶
func (co *CommandOption[OPT]) UseList() *CommandOption[OPT]
type EmptyOption ¶
type EmptyOption struct{}
type GlobalOptions ¶
type GlobalOptions struct { Debug bool `help:"Debug mode"` SUBCOMMAND string `help:"Cloudmux client subcommand" subcommand:"true"` Provider string `help:"Cloud provider" required:"true" choices:"Aliyun|Aws|Azure|Qcloud"` CloudEnv string `` /* 209-byte string literal not displayed */ AccessKey string `help:"Access key" default:"$CLOUDMUX_ACCESS_KEY" metavar:"CLOUDMUX_ACCESS_KEY"` Secret string `help:"Secret" default:"$CLOUDMUX_SECRET" metavar:"CLOUDMUX_SECRET"` Region string `help:"Default region" default:"$CLOUDMUX_REGION" metavar:"CLOUDMUX_REGION" short-token:"r"` }
type HostBaseOptions ¶
type HostBaseOptions struct { ZoneBaseOptions Host string `help:"Host ID"` }
func (HostBaseOptions) GetHostId ¶
func (o HostBaseOptions) GetHostId() string
type ICloudProvider ¶
type ICloudProvider interface { GetProvider() cloudprovider.ICloudProvider GetDefaultRegionId() string }
func NewCloudProvider ¶
func NewCloudProvider(opt *GlobalOptions) (ICloudProvider, error)
type IHostBaseOptions ¶
type IHostBaseOptions interface { IZoneBaseOptions GetHostId() string }
type IListOption ¶
type IRunner ¶
type IRunner[O any, C any] interface { RequireRegion() IRunner[O, C] RequireZone() IRunner[O, C] RequireHost() IRunner[O, C] List(suffix, desc string, cb func(cli C, args *O) (any, error)) GetterList(suffix, desc string, cb func(cli C, args *O) (any, error)) Run(suffix, desc string, cb func(cli C, args *O) (any, error)) }
func HostR ¶
func HostR[O IHostBaseOptions](cmd *Command) IRunner[O, cloudprovider.ICloudHost]
func ProviderR ¶
func ProviderR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudProvider]
func RegionR ¶
func RegionR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudRegion]
func ZoneR ¶
func ZoneR[O any](cmd *Command) IRunner[O, cloudprovider.ICloudZone]
type IZoneBaseOptions ¶
type IZoneBaseOptions interface {
GetZoneId() string
}
type ListBaseOptions ¶
type ListBaseOptions struct { Limit int `help:"Page size"` Offset int `help:"Page offset"` Details bool `help:"Show Details"` }
func (ListBaseOptions) GetColumns ¶
func (o ListBaseOptions) GetColumns() []string
func (ListBaseOptions) GetLimit ¶
func (o ListBaseOptions) GetLimit() int
func (ListBaseOptions) GetOffset ¶
func (o ListBaseOptions) GetOffset() int
func (ListBaseOptions) IsDetails ¶
func (o ListBaseOptions) IsDetails() bool
type ObjectHeaderOptions ¶
type ObjectHeaderOptions struct { CacheControl string `help:"Cache-Control"` ContentType string `help:"Content-Type"` ContentEncoding string `help:"Content-Encoding"` ContentLanguage string `help:"Content-Language"` ContentDisposition string `help:"Content-Disposition"` ContentMD5 string `help:"Content-MD5"` Meta []string `help:"header, common seperatored key and value, e.g. max-age:100"` }
func (ObjectHeaderOptions) Options2Header ¶
func (args ObjectHeaderOptions) Options2Header() http.Header
type SEmptyOptionRunner ¶
type SEmptyOptionRunner[C any] struct { // contains filtered or unexported fields }
func EmptyOptionProviderR ¶
func EmptyOptionProviderR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudProvider]
func EmptyOptionRegionR ¶
func EmptyOptionRegionR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudRegion]
func EmptyOptionRunner ¶
func EmptyOptionRunner[C any]( prefix string, rf func(*Command) IRunner[EmptyOption, C], ) *SEmptyOptionRunner[C]
func EmptyOptionZoneR ¶
func EmptyOptionZoneR(prefix string) *SEmptyOptionRunner[cloudprovider.ICloudZone]
func (*SEmptyOptionRunner[C]) GetterList ¶
func (er *SEmptyOptionRunner[C]) GetterList(suffix, desc string, cb func(cli C) (any, error))
type ZoneBaseOptions ¶
type ZoneBaseOptions struct {
Zone string `help:"Zone ID"`
}
func (ZoneBaseOptions) GetZoneId ¶
func (o ZoneBaseOptions) GetZoneId() string
type ZoneListOptions ¶
type ZoneListOptions struct {
ListBaseOptions
}
func (ZoneListOptions) GetColumns ¶
func (o ZoneListOptions) GetColumns() []string
Click to show internal directories.
Click to hide internal directories.