config

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Overview

Package config provides helpers for toml based config files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsValidationErrors

func AsValidationErrors(err error) (validator.ValidationErrors, bool)

AsValidationErrors gives access to a slice of validator.FieldError

func LoadFile

func LoadFile(filename string, v any) error

LoadFile reads a TOML encoded files applying shell expansions for environment variables into a configuration struct

func Prepare

func Prepare(v any) error

Prepare runs SetDefaults and Validate

func SetDefaults

func SetDefaults(v any) error

SetDefaults applies `defaults` structtags and SetDefaults() recursively

func Validate

func Validate(v any) error

Validate validates exposed fields including nested structs

func WriteTo

func WriteTo(f io.Writer, v any) (int64, error)

WriteTo writes to a given io.Writer the TOML encoded representation of a configuration struct

Types

This section is empty.

Jump to

Keyboard shortcuts

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