configparser

package
v0.0.0-...-2e6e198 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package configparser parsing configuration files into structs.

Works with YAML files, environment variables and default values. The order of importance: env vars > yaml file > default value.

If an empty file name is passed, it will look for a `.config.yml` file in `./`, `$HOME` and `/etc/app/`

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTargetNotPointer godoc
	ErrTargetNotPointer = errors.New("target is not pointer")
	// ErrFileDoesNotExist godoc
	ErrFileDoesNotExist = errors.New("file does not exist")
)

Functions

func Parse

func Parse(file string, target interface{}, defaults ...map[string]interface{}) error

Parse configuration from the file and set the results to target. Allows the setting of default values through the defaults arg.

Types

This section is empty.

Jump to

Keyboard shortcuts

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