dotenv

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 4 Imported by: 28

Documentation

Overview

Package dotenv implements a koanf.Parser that parses DOTENV bytes as conf maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DotEnv

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

DotEnv implements a DOTENV parser.

func Parser

func Parser() *DotEnv

Parser returns a DOTENV Parser.

func ParserEnv

func ParserEnv(prefix, delim string, cb func(s string) string) *DotEnv

ParserEnv allows to make the DOTENV Parser behave like the env.Provider.

func ParserEnvWithValue added in v1.0.0

func ParserEnvWithValue(prefix, delim string, cb func(key string, value string) (string, interface{})) *DotEnv

ParserEnvWithValue allows to make the DOTENV Parser behave like the env.ProviderWithValue.

func (*DotEnv) Marshal

func (p *DotEnv) Marshal(o map[string]interface{}) ([]byte, error)

Marshal marshals the given config map to DOTENV bytes.

func (*DotEnv) Unmarshal

func (p *DotEnv) Unmarshal(b []byte) (map[string]interface{}, error)

Unmarshal parses the given DOTENV bytes.

Jump to

Keyboard shortcuts

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