config

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupsToKeep = 4
)

Variables

This section is empty.

Functions

func FindAndReadYAML

func FindAndReadYAML(dir, filename string) (string, []byte, error)

FindAndReadYAML looks for filename in home directory if dir is empty, otherwise looks in specified directory.

func LoadAndCheckOSConfigfile

func LoadAndCheckOSConfigfile(
	filename string,
	loader func() (map[string]clientconfig.Cloud, error),
	cloudName string,
) (map[string]clientconfig.Cloud, error)

LoadAndCheckOSConfigfile loads and returns all the clouds found the specified filename. If cloudName is different from "" then cloudName is searched for in the clouds and an error is returned if cloudName is found.

func WriteOSConfig

func WriteOSConfig(directory string, clouds, secure, public []byte) (err error)

Types

type Clouds

type Clouds struct {
	Clouds       map[string]clientconfig.Cloud `yaml:"clouds" json:"clouds"`
	PublicClouds map[string]clientconfig.Cloud `yaml:"public-clouds" json:"public-clouds"` //nolint:tagliatelle
}

func LoadYAML

func LoadYAML(dir, filename string) (Clouds, error)

type YAMLOpts

type YAMLOpts struct {
	Directory string
}

YAMLOpts implements gophercloud util's YAMLOptsBuilder interface.

func (YAMLOpts) AllCloudNames

func (opts YAMLOpts) AllCloudNames() ([]string, error)

AllCloudNames returns all the possible cloud names.

func (YAMLOpts) AllProfileNames

func (opts YAMLOpts) AllProfileNames() ([]string, error)

AllProfileNames returns all the possible profile names.

func (YAMLOpts) LoadCloudsYAML

func (opts YAMLOpts) LoadCloudsYAML() (map[string]clientconfig.Cloud, error)

LoadCloudsYAML loads ~/.config/openstack/clouds.yaml.

func (YAMLOpts) LoadPublicCloudsYAML

func (opts YAMLOpts) LoadPublicCloudsYAML() (map[string]clientconfig.Cloud, error)

LoadPublicCloudsYAML loads ~/.config/openstack/clouds-public.yaml.

func (YAMLOpts) LoadSecureCloudsYAML

func (opts YAMLOpts) LoadSecureCloudsYAML() (map[string]clientconfig.Cloud, error)

LoadSecureCloudsYAML loads ~/.config/openstack/secure.yaml.

Jump to

Keyboard shortcuts

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