basic

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 2 more Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	APIUrl                string `json:"api-url"`
	TrustedCAFile         string `json:"trusted-ca-file"`
	InsecureSkipTLSVerify bool   `json:"insecure-skip-tls-verify"`
	*types.Tokens
}

Cluster contains the Sensu cluster access information

type Config

type Config struct {
	Cluster
	Profile
	// contains filtered or unexported fields
}

Config contains the CLI configuration

func Load

func Load(flags *pflag.FlagSet) *Config

Load imports the CLI configuration and returns an initialized Config struct

func (*Config) APIUrl

func (c *Config) APIUrl() string

APIUrl returns the active cluster API URL

func (*Config) Format

func (c *Config) Format() string

Format returns the user's preferred format

func (*Config) Namespace

func (c *Config) Namespace() string

Namespace returns the user's active namespace

func (*Config) SaveAPIUrl

func (c *Config) SaveAPIUrl(url string) error

SaveAPIUrl saves the API URL into a configuration file

func (*Config) SaveFormat

func (c *Config) SaveFormat(format string) error

SaveFormat saves the user's format preference into a configuration file

func (*Config) SaveNamespace

func (c *Config) SaveNamespace(namespace string) error

SaveNamespace saves the user's default namespace to a configuration file

func (*Config) SaveTokens

func (c *Config) SaveTokens(tokens *types.Tokens) error

SaveTokens saves the JWT into a configuration file

func (*Config) Tokens

func (c *Config) Tokens() *types.Tokens

Tokens returns the active cluster JWT

type Profile

type Profile struct {
	Format    string `json:"format"`
	Namespace string `json:"namespace"`
}

Profile contains the active configuration

Jump to

Keyboard shortcuts

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