Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v2.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Env:  "development",
	Name: "config",
	Type: "yaml",
}
View Source
var ErrInvalidConfigType = errors.New("invalid Configuration Type: JSON, YAML, TOML or \"\"(empty string)")

Functions

func New

func New(c ...Config) (*viper.Viper, error)

func NewWithModifier

func NewWithModifier(cfg Config, modifiers ...Modifier) (*viper.Viper, error)

Types

type Config

type Config struct {
	ProjectName string
	Env         string
	Name        string
	Type        string
	Paths       []string
}

type Modifier

type Modifier func(*viper.Viper)

Modifier function

type Type

type Type string
const (
	JSON Type = "json"
	YAML Type = "yaml"
	TOML Type = "toml"
)

func MustParseType

func MustParseType(configType string) Type

func ParseType

func ParseType(configType string) (Type, error)

Jump to

Keyboard shortcuts

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