util

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAPIServer specifies the default Alauda API endpoint.
	DefaultAPIServer string = "https://api.alauda.cn/v1/"

	// ConfigFileName specifies the configuration filename with extension.
	ConfigFileName string = ".alauda.yml"

	// SettingServer is the setting for the API server.
	SettingServer string = "auth.server"

	// SettingToken is the setting for the authentication token.
	SettingToken string = "auth.token"

	// SettingNamespace is the setting for the namespace.
	SettingNamespace string = "auth.namespace"

	// SettingUsername is the setting for username.
	SettingUsername string = "auth.username"

	// SettingCluster is the setting for the current cluster.
	SettingCluster string = "context.cluster"

	// SettingSpace is the setting for the current space.
	SettingSpace string = "context.space"
)

Variables

This section is empty.

Functions

func ConfigCluster

func ConfigCluster(cluster string) (string, error)

ConfigCluster uses the cluster specified by the cmd, or the one in the config, as appropriate.

func ConfigSpace added in v1.3.0

func ConfigSpace(space string) (string, error)

ConfigSpace uses the space specified by the cmd, or the one in the config, as appropriate.

func InitializeClient

func InitializeClient(client client.APIClient)

InitializeClient initializes the Alauda client from configuration.

func ParseImageNameTag

func ParseImageNameTag(image string) (string, string, error)

ParseImageNameTag extracts the image name and image tag.

func ParseKeyValues added in v1.1.0

func ParseKeyValues(descs []string) (map[string]string, error)

ParseKeyValues parses KEY=VALUE into a map of key value pairs.

func ParseListener

func ParseListener(desc string) (string, int, int, string, error)

ParseListener parses the listener information specified in the form name:listenerPort:containerPort/protocol

func Print

func Print(v interface{}) error

Print marshals the object into an indented JSON and prints it.

func PrintTable

func PrintTable(header []string, content [][]string)

PrintTable prints a table with the provided header and content.

func SaveConfig

func SaveConfig() error

SaveConfig writes all configuration back to the config file This is a temporary workaround until this PR gets merged. https://github.com/spf13/viper/pull/287

Types

This section is empty.

Jump to

Keyboard shortcuts

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