conf

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(file string, v interface{}) error

func LoadConfigFromJsonBytes

func LoadConfigFromJsonBytes(content []byte, v interface{}) error

func LoadConfigFromYamlBytes

func LoadConfigFromYamlBytes(content []byte, v interface{}) error

func MustLoad

func MustLoad(path string, v interface{})

Types

type Properties

type Properties interface {
	GetString(key string) string
	SetString(key, value string)
	GetInt(key string) int
	SetInt(key string, value int)
	ToString() string
}

Properties interface provides the means to access configuration.

func LoadProperties

func LoadProperties(filename string) (Properties, error)

Loads the properties into a properties configuration instance. Returns an error that indicates if there was a problem loading the configuration.

func NewProperties

func NewProperties() Properties

Builds a new properties configuration structure

type PropertyError

type PropertyError struct {
	// contains filtered or unexported fields
}

PropertyError represents a configuration error message.

func (*PropertyError) Error

func (configError *PropertyError) Error() string

Returns the error message.

Jump to

Keyboard shortcuts

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