kubekit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "kubekit",
	Short: "KubeKit is a Kubernetes toolkit",
	Long: `KubeKit is a toolkit for setting up a Kubernetes-powered cluster. It's the
easiest way to get a Kubernetes cluster on different platforms.`,
	Run: func(cmd *cobra.Command, args []string) {
		longVersion := cmd.Flags().Lookup("verbose").Changed
		if versionFlag {
			printVersion(longVersion)
			return
		}

		cmd.HelpFunc()(cmd, args)
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func AddCommands

func AddCommands()

AddCommands adds child commands to the root command

func Execute

func Execute()

Execute adds all child commands to the root command. This is called by main.main(). It only needs to happen once to the RootCmd.

func LoadConfig

func LoadConfig(cfgFile string) (*viper.Viper, error)

LoadConfig loads the configuration file into a Viper object

Types

type Config

type Config struct {
	UI             *ui.UI `json:"-" yaml:"-" toml:"-" mapstructure:"-"`
	Scroll         bool   `json:"scroll" yaml:"scroll" toml:"scroll" mapstructure:"scroll"`
	Verbose        bool   `json:"verbose" yaml:"verbose" toml:"verbose" mapstructure:"verbose"`
	Quiet          bool   `json:"quiet" yaml:"quiet" toml:"quiet" mapstructure:"quiet"`
	Debug          bool   `json:"debug" yaml:"debug" toml:"debug" mapstructure:"debug"`
	LogLevel       string `json:"log_level" yaml:"log_level" toml:"log_level" mapstructure:"log_level"`
	LogForceColors bool   `json:"log_color" yaml:"log_color" toml:"log_color" mapstructure:"log_color"`
	LogFile        string `json:"log" yaml:"log" toml:"log" mapstructure:"log"`
	ClustersPath   string `json:"clusters_path" yaml:"clusters_path" toml:"clusters_path" mapstructure:"clusters_path"`
	TemplatesPath  string `json:"templates_path" yaml:"templates_path" toml:"templates_path" mapstructure:"templates_path"`
	PKIPath        string `json:"pki_path" yaml:"pki_path" toml:"pki_path" mapstructure:"pki_path"`
	// contains filtered or unexported fields
}

Config is the KubeKit configuration that are obtained from all the sub-commands

func NewConfig

func NewConfig(command *cobra.Command) *Config

NewConfig create a new Config with default values

func (*Config) ClustersDir

func (c *Config) ClustersDir() string

ClustersDir returns the absolute directory path where the clusters config are

func (*Config) Dir

func (c *Config) Dir() string

Dir returns the absolute directory path of the configuration file

func (*Config) JSON

func (c *Config) JSON(pp bool) (string, error)

JSON return the configuration in JSON format

func (*Config) PKIDir

func (c *Config) PKIDir() string

PKIDir returns the KubeKit PKI directory. Here is where the server store the certificates

func (*Config) String

func (c *Config) String() string

Stringf returns the configuration in the format defined in cfgShowFormat and pretty print if it's JSON

func (*Config) Stringf

func (c *Config) Stringf(format string, pp bool) (string, error)

Stringf returns the configuration in the requested format and alows to choose pretty print if it's JSON. If no format is provided will return it in the format defined in cfgShowFormat or JSON

func (*Config) TOML

func (c *Config) TOML() (string, error)

TOML return the configuration in TOML format

func (*Config) TemplatesDir

func (c *Config) TemplatesDir() string

TemplatesDir returns the absolute directory path where the templates are

func (*Config) Text

func (c *Config) Text(pp bool) (string, error)

Text return the configuration in human readable format with more information and even more if debug flag is set

func (*Config) UpdateViper

func (c *Config) UpdateViper(v *viper.Viper)

UpdateViper refresh all the config settings from viper keys

func (*Config) YAML

func (c *Config) YAML() (string, error)

YAML return the configuration in YAML format

Jump to

Keyboard shortcuts

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