structs

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 3 Imported by: 93

Documentation

Overview

Package structs implements a koanf.Provider that takes a struct and tag and returns a nested config map (using fatih/structs) to provide it to koanf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Structs

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

Structs implements a structs provider.

func Provider

func Provider(s interface{}, tag string) *Structs

Provider returns a provider that takes a takes a struct and a struct tag and uses structs to parse and provide it to koanf.

func ProviderWithDelim

func ProviderWithDelim(s interface{}, tag, delim string) *Structs

ProviderWithDelim returns a provider that takes a struct and a struct tag along with a delim and uses structs to parse and provide it to koanf.

func (*Structs) Read

func (s *Structs) Read() (map[string]interface{}, error)

Read reads the struct and returns a nested config map.

func (*Structs) ReadBytes

func (s *Structs) ReadBytes() ([]byte, error)

ReadBytes is not supported by the structs provider.

Jump to

Keyboard shortcuts

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