config

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Sep = "."
)

Variables

View Source
var ErrInvalid = errors.New("invalid")
View Source
var ErrNotFound = errors.New("not found")

Functions

func NewPathWith

func NewPathWith(elems ...string) string

NewPath returns a new path with the specified elements.

Types

type Config

type Config interface {
	// UseConfigFile uses the specified file as the configuration.
	UsedConfigFile() string
	// GetConfig returns a value for the specified name.
	GetConfig(paths ...string) (any, error)
	// GetConfigString returns a string value for the specified name.
	GetConfigString(paths ...string) (string, error)
	// GetConfigInt returns an integer value for the specified name.
	GetConfigInt(paths ...string) (int, error)
	// GetConfigBool returns a boolean value for the specified name.
	GetConfigBool(paths ...string) (bool, error)
	// String returns a string representation of the configuration.
	String() string
}

Config represents a configuration interface.

func NewConfigWith

func NewConfigWith(productName string) Config

NewConfigWith creates a new configuration with the specified product name.

Jump to

Keyboard shortcuts

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