config

package
v0.0.0-...-19e6d8b Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(cfg *ClusterConfig)

Types

type Cluster

type Cluster struct {
	Name  string   `yaml:"Name"`
	Hosts []string `yaml:"Hosts"`
}

func (Cluster) String

func (c Cluster) String() string

type ClusterConfig

type ClusterConfig struct {
	CurrentCluster string    `yaml:"CurrentCluster"`
	Clusters       []Cluster `yaml:"Clusters"`
	// contains filtered or unexported fields
}

func New

func New(w fs.WriteFn, r fs.ReadFn) *ClusterConfig

func (*ClusterConfig) AddCluster

func (c *ClusterConfig) AddCluster() error

func (*ClusterConfig) DeleteCluster

func (c *ClusterConfig) DeleteCluster(name string) error

func (*ClusterConfig) GetCurrentCluster

func (c *ClusterConfig) GetCurrentCluster() *Cluster

func (*ClusterConfig) Load

func (c *ClusterConfig) Load(cfgFile string) error

func (*ClusterConfig) SetActive

func (c *ClusterConfig) SetActive(name string) error

func (ClusterConfig) String

func (cc ClusterConfig) String() string

func (*ClusterConfig) UpdateCluster

func (c *ClusterConfig) UpdateCluster(name, newHosts string) error

Jump to

Keyboard shortcuts

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