config

package
v0.0.0-...-678e9c6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFileName = "config.yaml"

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(envName string, env *ConfigEnvironment, configPath string) error

creates a config into default file

func GetDefaultConfigPath

func GetDefaultConfigPath() string

func RemoveConfig

func RemoveConfig(envName string, configPath string) error

Types

type CliOptions

type CliOptions struct {
	Env        string
	ConfigPath string
}

func NewCliOptions

func NewCliOptions() *CliOptions

type ConfigEnvironment

type ConfigEnvironment struct {
	Name     string
	Host     string
	Database string
	Port     uint16
	User     string
	Password string
	Default  bool
}

func DefaultConfig

func DefaultConfig() *ConfigEnvironment

Used to the test environment. This params would not be used for production

func ListConfigs

func ListConfigs(path string) ([]*ConfigEnvironment, error)

func LoadConfig

func LoadConfig(path string, env string) (*ConfigEnvironment, error)

func (*ConfigEnvironment) Headers

func (c *ConfigEnvironment) Headers() []string

func (*ConfigEnvironment) Values

func (c *ConfigEnvironment) Values() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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