config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfig added in v0.3.0

func GetDefaultConfig() string

GetDefaultConfig returns the default config string

Types

type CommentSectionNames added in v0.6.3

type CommentSectionNames struct {
	Keys []string `ini:"key,omitempty,allowshadow"`
}

CommentSectionNames are the sections that will be ignored

type Config

type Config struct {
	Name                string
	Filename            string               `ini:"filename"`
	Environments        *Environments        `ini:"environments"`
	CommentSectionNames *CommentSectionNames `ini:"comments"`
	Created             time.Time            `ini:"-"`
	Expand              bool                 `ini:"expand"`
	Isolated            bool                 `ini:"isolated"`
	ExportEnvName       string               `ini:"export_environment"`
	ExportEnvNameOld    string               `ini:"exportEnvironment"`
	Meta                *Meta                `ini:"metadata"`
	Template            *Template            `ini:"template"`
	Ignored             map[string][]string
	Required            map[string][]string
	Restart             bool     `ini:"restart"`
	ExcludeFromRestart  []string `ini:"restart_exclude"`
	RestartForever      bool     `ini:"restart_forever"`
	MaxRestarts         int      `ini:"max_restarts"`
}

Config has the rc config options

func Load

func Load(name string) (*Config, error)

Load returns configuration object from `.envsetrc` file

func (*Config) Get added in v0.4.1

func (c *Config) Get(key string) string

Get will return the value of the given key

func (*Config) ListKeys added in v0.6.2

func (c *Config) ListKeys() []string

ListKeys returns the list of config keys

func (*Config) MergeIgnored added in v0.4.0

func (c *Config) MergeIgnored(section string, ignored []string) []string

MergeIgnored will merge ignored values from flags with values from envsetrc for a given section

func (*Config) MergeRequired added in v0.4.0

func (c *Config) MergeRequired(section string, required []string) []string

MergeRequired will merge ignored values from flags with values from envsetrc for a given section

func (*Config) RestartForEnv added in v0.6.4

func (c *Config) RestartForEnv(env string) bool

RestartForEnv will return the restart value based on the env

type Environments added in v0.6.3

type Environments struct {
	Names []string `ini:"name,omitempty,allowshadow"`
}

Environments holds the environment names

type Meta added in v0.6.3

type Meta struct {
	Dir    string `ini:"dir"`
	File   string `ini:"file"`
	Print  bool   `ini:"print"`
	AsJSON bool   `ini:"json"`
}

Meta are options for the metadata command

type Template added in v0.6.3

type Template struct {
	Dir  string `ini:"dir"`
	File string `ini:"file"`
}

Template are options to generate the template output

Jump to

Keyboard shortcuts

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