config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 4 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 Config

type Config struct {
	Name         string
	Filename     string `ini:"filename"`
	Environments struct {
		Name []string `ini:"name,omitempty,allowshadow"`
	} `ini:"environments"`
	Created       time.Time `ini:"-"`
	Expand        bool      `ini:"expand"`
	Isolated      bool      `ini:"isolated"`
	ExportEnvName string    `ini:"export_environment"`
	Meta          struct {
		Dir    string `ini:"dir"`
		File   string `ini:"file"`
		Print  bool   `ini:"print"`
		AsJSON bool   `ini:"json"`
	} `ini:"metadata"`
	Template struct {
		Path string `ini:"path"`
		File string `ini:"file"`
	} `ini:"template"`
	Ignored  map[string][]string
	Required map[string][]string
}

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) 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

Jump to

Keyboard shortcuts

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