structs

package
v0.14.1-0...-f32e4ce Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 2 Imported by: 0

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 (*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.

func (*Structs) Watch

func (s *Structs) Watch(cb func(event interface{}, err error)) error

Watch 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