configfile

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigTemplateFile

func CreateConfigTemplateFile(filename string) error

Create configuration template file on specified path.

func WriteByteToFile

func WriteByteToFile(filename string, fileData []byte) error

Types

type Configuration

type Configuration struct {
	Location string
	// contains filtered or unexported fields
}

func InitConfiguration

func InitConfiguration(path string) (*Configuration, error)

Load configuration profiles from a yaml file on specified path.

func (*Configuration) AddProfile

func (c *Configuration) AddProfile(name string, username string, token string, domainid string, region string, projectid string, apiurl string) error

Add new profile to the configuration file.

func (*Configuration) GetActiveProfile

func (c *Configuration) GetActiveProfile() string

Return current active profile name.

func (*Configuration) GetProfileMap

func (c *Configuration) GetProfileMap(profile string) (map[string]interface{}, error)

Return profile map[FieldTag]FieldValue.

func (*Configuration) ProfilesSlice

func (c *Configuration) ProfilesSlice() []string

Return profile names slice.

func (*Configuration) SetActiveProfile

func (c *Configuration) SetActiveProfile(profile string) error

Set active profile from existing profiles in the file.

func (*Configuration) SetProfileField

func (c *Configuration) SetProfileField(key string, value string) error

Set arbitrary (among available profile fields) profile field value.

Jump to

Keyboard shortcuts

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