config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 5 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 {
	Name        string
	Addrs       []string `yaml:"addrs"`
	Password    string   `yaml:"password"`
	Description string   `yaml:"desc"`
	IsSafeMode  bool     `yaml:"isSafeMode" default:"false"`
}

type Config

type Config struct {
	CurrentCluster  string `yaml:"current-cluster"`
	ClusterOverride string
	Clusters        []*Cluster `yaml:"clusters"`
}

func ReadConfig

func ReadConfig(cfgPath string) (c Config, err error)

func (*Config) ActiveCluster

func (c *Config) ActiveCluster() *Cluster

func (*Config) SetCurrentCluster

func (c *Config) SetCurrentCluster(name string) error

func (*Config) Write

func (c *Config) Write() error

Jump to

Keyboard shortcuts

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