cli

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigPath string
View Source
var ErrConfigPathUnknown = errors.New("config file path unknown")
View Source
var Version = "was not built properly"

Version is set via compiler flags (see script/build.bash)

Functions

func MarshalConfig

func MarshalConfig(c *Config) ([]byte, error)

func NewRootCommand

func NewRootCommand(cli *CLI) *cobra.Command

func UnmarshalConfig

func UnmarshalConfig(config *Config, data []byte) error

Types

type CLI

type CLI struct {
	Token         string
	Endpoint      string
	Context       context.Context
	Config        *Config
	ConfigPath    string
	Debug         bool
	DebugFilePath string

	RootCommand *cobra.Command
	// contains filtered or unexported fields
}

func NewCLI

func NewCLI() *CLI

func (*CLI) ActionProgress

func (c *CLI) ActionProgress(ctx context.Context, action *hcloud.Action) error

func (*CLI) CertificateLabelKeys added in v1.19.0

func (c *CLI) CertificateLabelKeys(idOrName string) []string

func (*CLI) CertificateNames added in v1.19.0

func (c *CLI) CertificateNames() []string

func (*CLI) Client

func (c *CLI) Client() *hcloud.Client

func (*CLI) DataCenterNames added in v1.19.0

func (c *CLI) DataCenterNames() []string

func (*CLI) FloatingIPLabelKeys added in v1.19.0

func (c *CLI) FloatingIPLabelKeys(idOrName string) []string

func (*CLI) FloatingIPNames added in v1.19.0

func (c *CLI) FloatingIPNames() []string

func (*CLI) ISONames added in v1.19.0

func (c *CLI) ISONames() []string

func (*CLI) ImageLabelKeys added in v1.19.0

func (c *CLI) ImageLabelKeys(idOrName string) []string

func (*CLI) ImageNames added in v1.19.0

func (c *CLI) ImageNames() []string

func (*CLI) LoadBalancerLabelKeys added in v1.19.0

func (c *CLI) LoadBalancerLabelKeys(idOrName string) []string

func (*CLI) LoadBalancerNames added in v1.19.0

func (c *CLI) LoadBalancerNames() []string

func (*CLI) LoadBalancerTypeNames added in v1.19.0

func (c *CLI) LoadBalancerTypeNames() []string

func (*CLI) LocationNames added in v1.19.0

func (c *CLI) LocationNames() []string

func (*CLI) NetworkLabelKeys added in v1.19.0

func (c *CLI) NetworkLabelKeys(idOrName string) []string

func (*CLI) NetworkName added in v1.19.0

func (c *CLI) NetworkName(id int) string

func (*CLI) NetworkNames added in v1.19.0

func (c *CLI) NetworkNames() []string

func (*CLI) ReadConfig

func (c *CLI) ReadConfig() error

func (*CLI) ReadEnv

func (c *CLI) ReadEnv()

func (*CLI) SSHKeyLabelKeys added in v1.19.0

func (c *CLI) SSHKeyLabelKeys(idOrName string) []string

func (*CLI) SSHKeyNames added in v1.19.0

func (c *CLI) SSHKeyNames() []string

func (*CLI) ServerLabelKeys added in v1.19.0

func (c *CLI) ServerLabelKeys(idOrName string) []string

func (*CLI) ServerName added in v1.19.0

func (c *CLI) ServerName(id int) string

func (*CLI) ServerNames added in v1.19.0

func (c *CLI) ServerNames() []string

func (*CLI) ServerTypeNames added in v1.19.0

func (c *CLI) ServerTypeNames() []string

func (*CLI) Terminal

func (c *CLI) Terminal() bool

Terminal returns whether the CLI is run in a terminal.

func (*CLI) VolumeLabelKeys added in v1.19.0

func (c *CLI) VolumeLabelKeys(idOrName string) []string

func (*CLI) VolumeNames added in v1.19.0

func (c *CLI) VolumeNames() []string

func (*CLI) WaitForActions added in v1.10.0

func (c *CLI) WaitForActions(ctx context.Context, actions []*hcloud.Action) error

func (*CLI) WriteConfig

func (c *CLI) WriteConfig() error

type Config

type Config struct {
	Endpoint      string
	ActiveContext *ConfigContext
	Contexts      []*ConfigContext
}

func (*Config) ContextByName

func (config *Config) ContextByName(name string) *ConfigContext

func (*Config) ContextNames added in v1.19.0

func (config *Config) ContextNames() []string

func (*Config) RemoveContext

func (config *Config) RemoveContext(context *ConfigContext)

type ConfigContext

type ConfigContext struct {
	Name  string
	Token string
}

type ContextPresentation added in v1.12.0

type ContextPresentation struct {
	Name   string
	Token  string
	Active string
}

type RawConfig

type RawConfig struct {
	ActiveContext string             `toml:"active_context,omitempty"`
	Contexts      []RawConfigContext `toml:"contexts"`
}

type RawConfigContext

type RawConfigContext struct {
	Name  string `toml:"name"`
	Token string `toml:"token"`
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL