config

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfigPath

func GetDefaultConfigPath() (defaultConfigPath string, err error)

GetDefaultConfigPath returns the default configuration file path

Types

type Config

type Config struct {
	Oscar   map[string]*cluster.Cluster `json:"oscar" binding:"required"`
	Default string                      `json:"default,omitempty"`
}

Config stores the configuration of oscar-cli

func ReadConfig

func ReadConfig(configPath string) (config *Config, err error)

ReadConfig reads the configuration file

func (*Config) AddCluster

func (config *Config) AddCluster(configPath string, id string, endpoint string, authUser string, authPassword string, oidcAccountName string, sslVerify bool) error

AddCluster adds a new cluster to the config

func (*Config) CheckCluster

func (config *Config) CheckCluster(id string) error

CheckCluster checks if a cluster exists and return error if not

func (*Config) RemoveCluster

func (config *Config) RemoveCluster(configPath, id string) error

RemoveCluster removes a cluster from the config

func (*Config) SetDefault

func (config *Config) SetDefault(configPath, id string) error

SetDefault set a default cluster in the config file

Jump to

Keyboard shortcuts

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