config

package
v0.12.19 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterKey

func GetClusterKey(cluster string) string

GetClusterKey returns the registered key path for a cluster

Types

type ClusterName

type ClusterName string

ClusterName is the name of an ECS Cluster (example: "mountain")

type Config

type Config struct {
	Keys Keys `yaml:"keys"`
}

Config represents global application configuration

type FilePath

type FilePath string

FilePath is the path to a yaml file on disk

type Keys

type Keys map[ClusterName]FilePath

Keys is a map of cluster names

func ReadKeys

func ReadKeys(adapter Storage) (Keys, error)

ReadKeys returns you the existing keys if they exist, if not, will return a new, blank, Keys struct

type Storage

type Storage interface {
	ReadKeys() (Keys, error)
	SaveKeys(Keys) error
	IsModified() bool
}

Storage is a mechanism for storing ECS Commander Config!

type YAMLFile

type YAMLFile struct {
	// contains filtered or unexported fields
}

YAMLFile stores config in a YAML file on disk, this is the default. It implements the storage adapter interface.

func GetYAMLConfig

func GetYAMLConfig() *YAMLFile

GetYAMLConfig gets, or creates, a yaml configuration file from disk

func NewYAMLFile

func NewYAMLFile() *YAMLFile

NewYAMLFile creates a new and empty YAML file

func ReadYAMLFile

func ReadYAMLFile(path string) *YAMLFile

ReadYAMLFile Sets the file to be used for storing config

func (*YAMLFile) IsModified

func (yamlFile *YAMLFile) IsModified() bool

IsModified implements a modified

func (*YAMLFile) ReadKeys

func (yamlFile *YAMLFile) ReadKeys() (Keys, error)

ReadKeys implements a key reader for yaml files

func (*YAMLFile) SaveKeys

func (yamlFile *YAMLFile) SaveKeys(keys Keys) error

SaveKeys implements a key writer for yaml files

Jump to

Keyboard shortcuts

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