confiqenv

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package confiqenv allows confiq values to be loaded from Env format.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotGetBytesFromReader = errors.New("cannot get bytes from reader")
	ErrCannotOpenEnvFile        = errors.New("cannot open Env file")
	ErrCannotReadEnvData        = errors.New("cannot read Env data")
)

Functions

This section is empty.

Types

type Container

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

Container is a struct that holds the loaded values.

func Load

func Load() *Container

Load creates an empty container, into which the JSON values can be loaded.

func (*Container) Errors

func (c *Container) Errors() []error

Errors returns the errors that occurred during the loading process.

func (*Container) FromBytes

func (c *Container) FromBytes(input []byte) *Container

FromBytes loads a Env file from the given bytes.

func (*Container) FromEnvironment

func (c *Container) FromEnvironment() *Container

FromEnvironment loads config data from the environment variables.

func (*Container) FromFile

func (c *Container) FromFile(path string) *Container

FromFile loads a Env file from the given path.

func (*Container) FromReader

func (c *Container) FromReader(reader io.Reader) *Container

FromReader loads a Env file from a reader stream.

func (*Container) FromString

func (c *Container) FromString(input string) *Container

FromString loads a Env file from the given string.

func (*Container) Get

func (c *Container) Get() []any

Get returns the loaded JSON values.

Jump to

Keyboard shortcuts

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