Documentation ¶
Index ¶
- Constants
- Variables
- type Command
- type Config
- type InvalidURNErr
- type LiveCommand
- type LiveConfig
- func (c *LiveConfig) GetBool(ns, key string) (bool, error)
- func (c *LiveConfig) GetInt(ns, key string) (int, error)
- func (c *LiveConfig) GetString(ns, key string) (string, error)
- func (c *LiveConfig) GetStringSlice(ns, key string) ([]string, error)
- func (c *LiveConfig) IsSet(key string) bool
- func (c *LiveConfig) Set(ns, key string, val interface{})
- type MissingArgsErr
- type MockCommand
- type Version
Constants ¶
const ( // ArgAccessToken is the access token to be used for the operations ArgAccessToken = "access-token" // ArgContext is the name of the auth context to use ArgContext = "context" // ArgUserID is a user id argument. ArgUserID = "userid" // ArgClusterNameSlug is a datacenter slug argument. ArgClusterNameSlug = "cluster-name" // ArgTypeSlug is a type slug argument. ArgTypeSlug = "type" // ArgFormat is columns to include in output argment. ArgFormat = "format" // ArgNoHeader hides the output header. ArgNoHeader = "no-header" // ArgOutput is an output type argument. ArgOutput = "output" // ArgForce forces confirmation on actions ArgForce = "force" // ArgAppIDSlug is a id slug argument. ArgAppIDSlug = "app-id" // ArgAppNameSlug is a name slug argument. ArgAppNameSlug = "app-name" // ArgNsIDSlug is a namespace id slug argument. ArgNsIDSlug = "ns-id" // ArgNsNameSlug is a namespace name slug argument. ArgNsNameSlug = "ns-name" // ArgNsCpuLimitSlug is a namespace cpu limit slug argument. ArgNsCpuLimitSlug = "cpu-limit" // ArgNsMemLimitSlug is a namespace mem limit slug argument. ArgNsMemLimitSlug = "mem-limit" // ArgNsStorageLimitSlug is a namespace storage limit slug argument. ArgNsStorageLimitSlug = "storage-limit" // ArgNsClusterIdSlug is a namespace cluster id slug argument. ArgNsClusterIDSlug = "ns-cluster-id" // ArgChartRepoSlug is a chart repo slug argument. ArgChartRepoSlug = "chart-repo" // ArgListRepoSlug is a chart list repo slug argument. ArgListRepoSlug = "list-repo" // ArgDetailRepoSlug is a chart detail repo slug argument. ArgDetailRepoSlug = "detail-repo" // ArgSourceRepoSlug is a saveas chart source repo slug argument. ArgSourceRepoSlug = "source-repo" // ArgSaveRepoSlug is a saveas chart save repo slug argument. ArgSaveRepoSlug = "save-repo" // ArgDownloadRepoSlug is a download chart repo slug argument. ArgDownloadRepoSlug = "download-repo" // ArgChartNameSlug is a chart image slug argument. ArgChartNameSlug = "chart-name" // ArgUploadVersionSlug is a chart upload version slug argument. ArgUploadVersionSlug = "upload-version" // ArgSourceNameSlug is a chart source image slug argument. ArgSourceNameSlug = "source-name" // ArgChartVersionSlug is a chart version slug argument. ArgChartVersionSlug = "chart-version" // ArgUpdateVersionSlug is a update app chart version slug argument. ArgUpdateVersionSlug = "update-version" // ArgDownloadVersionSlug is a download chart version slug argument. ArgDownloadVersionSlug = "download-version" // ArgDeleteVersionSlug is a download chart version slug argument. ArgDeleteVersionSlug = "delete-version" // ArgSourceVersionSlug is a saveas chart source version slug argument. ArgSourceVersionSlug = "source-version" // ArgSaveasVersionSlug is a chart saveas version slug argument. ArgSaveasVersionSlug = "saveas-version" // ArgShowVersionSlug is a chart detail show version slug argument. ArgShowVersionSlug = "show-version" // ArgChartFileSlug is a chart file slug argument. ArgChartFileSlug = "chart-file" // ArgUploadFileSlug is a chart file slug argument. ArgUploadFileSlug = "upload-file" // ArgValuesYamlSlug is a values file slug argument. ArgValuesYamlSlug = "values-yaml" // ArgPasswordSlug is a user password slug argument. ArgPasswordSlug = "password" // ArgEmailSlug is a user email slug argument. ArgEmailSlug = "email" // ArgAddressSlug is a wallet address slug argument. ArgAddressSlug = "address" // ArgTargetAddressSlug is a wallet send token target address slug argument. ArgTargetAddressSlug = "target-address" // ArgKeyStoreSlug is a wallet keystore slug argument. ArgKeyStoreSlug = "keystore" // ArgKeyNameSlug is a wallet key name slug argument. ArgKeyNameSlug = "keyname" // ArgPrivateKeySlug is a wallet private key slug argument. ArgPrivateKeySlug = "private-key" // ArgPublicKeySlug is a wallet public key slug argument. ArgPublicKeySlug = "public-key" // ArgAddressTypeSlug is a wallet address type slug argument. ArgAddressTypeSlug = "type" // ArgAddressPurposeSlug is a wallet address purpose slug argument. ArgAddressPurposeSlug = "purpose" // ArgSearchDepositStartSlug is a wallet search deposit start date slug argument. ArgSearchDepositStartSlug = "deposit-startdate" // ArgSearchDepositEndSlug is a wallet search deposit end date slug argument. ArgSearchDepositEndSlug = "deposit-enddate" // ArgRegisterCodeSlug is a user registration confirmation code slug argument. ArgRegisterCodeSlug = "register-code" // ArgPasswordCodeSlug is a password registration confirmation code slug argument. ArgPasswordCodeSlug = "password-code" // ArgConfirmPasswordSlug is a password reset confirmation new password slug argument. ArgConfirmPasswordSlug = "confirm-password" // ArgNewPasswordSlug is a change new password slug argument. ArgNewPasswordSlug = "new-password" // ArgOldPasswordSlug is a change old password slug argument. ArgOldPasswordSlug = "old-password" // ArgUpdateKeySlug is a update user attribute key slug argument. ArgUpdateKeySlug = "update-key" // ArgUpdateValueSlug is a update user attribute value slug argument. ArgUpdateValueSlug = "update-value" // ArgEmailCodeSlug is a confirm email change slug argument. ArgEmailCodeSlug = "email-code" )
const (
// ArgShortForce forces confirmation on actions
ArgShortForce = "f"
)
const (
// NSRoot is a configuration key that signifies this value is at the root.
NSRoot = "ankrctl"
)
Variables ¶
var ( // AnkrConfig holds the app's current configuration. AnkrConfig Config = &LiveConfig{} // AnkrVersion is ankr's version. AnkrVersion = Version{ Major: 1, Minor: 11, Patch: 0, Label: "dev", } // Build is ankr's build tag. Build string // Major is ankrctl's major version. Major string // Minor is ankrctl's minor version. Minor string // Patch is ankrctl's patch version. Patch string // Label is ankrctl's label. Label string )
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Run(args ...string) ([]byte, error) Start(args ...string) error Stop() error }
Command runs commands.
type Config ¶
type Config interface { Set(ns, key string, val interface{}) IsSet(key string) bool GetString(ns, key string) (string, error) GetBool(ns, key string) (bool, error) GetInt(ns, key string) (int, error) GetStringSlice(ns, key string) ([]string, error) }
Config is an interface that represent ankr's config.
type InvalidURNErr ¶
type InvalidURNErr struct {
URN string
}
InvalidURNErr is an error returned when their are too few arguments for a command.
func NewInvalidURNErr ¶
func NewInvalidURNErr(urn string) *InvalidURNErr
NewInvalidURNErr creates a InvalidURNErr instance.
func (*InvalidURNErr) Error ¶
func (e *InvalidURNErr) Error() string
type LiveCommand ¶
type LiveCommand struct {
// contains filtered or unexported fields
}
LiveCommand is a live implementation of Command.
func NewLiveCommand ¶
func NewLiveCommand(path string) *LiveCommand
NewLiveCommand creates a LiveCommand.
func (*LiveCommand) Run ¶
func (c *LiveCommand) Run(args ...string) ([]byte, error)
Run runs a LiveCommand with args and returns stdout and an error if there was one.
func (*LiveCommand) Start ¶
func (c *LiveCommand) Start(args ...string) error
Start runs a LiveCommand with args and starts it. This would most likely block, so you should call it in a goroutine.
type LiveConfig ¶
type LiveConfig struct {
// contains filtered or unexported fields
}
LiveConfig is an implementation of Config for live values.
func (*LiveConfig) GetBool ¶
func (c *LiveConfig) GetBool(ns, key string) (bool, error)
GetBool returns a config value as a bool.
func (*LiveConfig) GetInt ¶
func (c *LiveConfig) GetInt(ns, key string) (int, error)
GetInt returns a config value as an int.
func (*LiveConfig) GetString ¶
func (c *LiveConfig) GetString(ns, key string) (string, error)
GetString returns a config value as a string.
func (*LiveConfig) GetStringSlice ¶
func (c *LiveConfig) GetStringSlice(ns, key string) ([]string, error)
GetStringSlice returns a config value as a string slice.
func (*LiveConfig) IsSet ¶
func (c *LiveConfig) IsSet(key string) bool
func (*LiveConfig) Set ¶
func (c *LiveConfig) Set(ns, key string, val interface{})
Set sets a config key.
type MissingArgsErr ¶
type MissingArgsErr struct {
Command string
}
MissingArgsErr is an error returned when their are too few arguments for a command.
func NewMissingArgsErr ¶
func NewMissingArgsErr(cmd string) *MissingArgsErr
NewMissingArgsErr creates a MissingArgsErr instance.
func (*MissingArgsErr) Error ¶
func (e *MissingArgsErr) Error() string
type MockCommand ¶
type MockCommand struct {
// contains filtered or unexported fields
}
MockCommand is a mock command implementation. It allows you simulate running an external command.
func NewMockCommand ¶
func NewMockCommand(path string) *MockCommand
NewMockCommand createsd a MockCommand.
func (*MockCommand) Run ¶
func (c *MockCommand) Run(args ...string) ([]byte, error)
Run simulates the running of a command.
func (*MockCommand) Start ¶
func (c *MockCommand) Start(args ...string) error
Start simulates starting a command.