action

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagDebug turn on debugging output
	FlagDebug = "debug"
	// EnvDebug turn on debugging output
	EnvDebug = "DEBUG"
	// FlagVaaSURL address of the VaaS host to query
	FlagVaaSURL = "vaas-url"
	// EnvVaaSURL address of the VaaS host to query
	EnvVaaSURL = "VAAS_URL"
	// FlagUser represents the user name for Auth
	FlagUser = "user"
	// EnvVaaSUser represents the user name for Auth
	EnvVaaSUser = "VAAS_USER"
	// FlagSecretKey client key for Auth
	FlagSecretKey = "key"
	// EnvVaaSKey client key for Auth
	EnvVaaSKey = "VAAS_KEY"
	// FlagSecretKeyFile client key for Auth
	FlagSecretKeyFile = "key-file"
	// EnvVaaSKeyFile client key for Auth
	EnvVaaSKeyFile = "VAAS_KEY_FILE"
	// FlagDirector represents the director name
	FlagDirector = "director"
	// FlagAddr address of this backend
	FlagAddress = "addr"
	// FlagPort represents the port of this backend
	FlagPort = "port"
	// FlagCanaryTag
	FlagCanaryTag = "canary"

	// IDFileLoc file containing VaaS backend ID
	IDFileLoc = "/tmp/vaas.id"
)

These Flag* consts exist to make any changes to flags consistent across the project

View Source
const (
	// DeregisterName is the CLI name of this action
	DeregisterName = "deregister"
	// FlagBackendID represents a known backend id that is to be deregistered
	FlagBackendID = "backend-id, id"
)
View Source
const (
	// RegisterName is the CLI name of this action
	RegisterName = "register"

	// FlagWeight is the weight that a backend in VaaS is initially assigned
	FlagWeight = "weight"
	// FlagDC represents datacenter short name as defined in VaaS
	FlagDC = "dc"
	// EnvDC Environment var containing datacenter short name as defined in VaaS
	EnvDC = "CLOUD_DC"
	// InstanceFormat represents a backend instance tag
	InstanceFormat = "instance:%s_%d"
)

Variables

This section is empty.

Functions

func DeregisterCLI

func DeregisterCLI(c *cli.Context) error

DeregisterCLI removes a backend from VaaS using CLI data

func DeregisterK8s

func DeregisterK8s(podInfo *k8s.PodInfo, config CommonConfig) (err error)

DeregisterK8s configures a VaaS client from K8s data and removes a backend

func GetDeregisterFlags

func GetDeregisterFlags() []cli.Flag

GetDeregisterFlags returns a list of flags available for this action

func GetRegisterFlags

func GetRegisterFlags() []cli.Flag

GetRegisterFlags returns a list of flags available for this action

func RegisterCLI

func RegisterCLI(c *cli.Context) error

RegisterCLI configures a VaaS client from CLI data and runs register()

func RegisterK8s

func RegisterK8s(podInfo *k8s.PodInfo, config CommonConfig) (err error)

RegisterK8s configures a VaaS client from K8s data and runs register()

Types

type CommonConfig

type CommonConfig struct {
	Debug        bool
	DryRun       bool
	Canary       bool
	Director     string
	Address      string
	VaaSURL      string
	VaaSUser     string
	VaaSKey      string
	VaaSKeyFile  string
	Port         int
	AsyncTimeout time.Duration
}

CommonConfig represents common flag values

func (*CommonConfig) GetSecretFromFile added in v0.1.15

func (config *CommonConfig) GetSecretFromFile(secretFile string) error

GetSecretFromFile reads a value from provided file

Jump to

Keyboard shortcuts

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