config

package
v0.0.0-...-6146efe Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader interface {
	Import(data []byte) error
	Initialize() error
	Get(key string) ([]byte, error)
	Put(key string, value []byte) error

	// Must functions will panic if they can't do what is requested.
	// They are maingly meant for use with configs that are required for an app to start up
	MustGetString(key string) string
	MustGetBool(key string) bool
	MustGetInt(key string) int
	MustGetDuration(key string) time.Duration
}

Loader is a object that can import, initialize, and Get config values

func NewMappedLoader

func NewMappedLoader(data []byte) (Loader, error)

NewMappedLoader creates a Loader that will build config from JSON and store it in a a basic map This is meant to be a stubbed / example implementation of a loader, its not really actually meant to be used in a production environment.

Directories

Path Synopsis
Package loadermock is a generated GoMock package.
Package loadermock is a generated GoMock package.

Jump to

Keyboard shortcuts

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