fileconf

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fileconf is configuration loader for the conf package. It loads configuration layers from YAML, JSON or TOML files. Configuration locators for this loader are relative pathes or glob patterns. See standart package path/filepath for more information about syntax of glob patterns. Here some examples:

file:myapp/dirs.yml
file:myapp/servers.toml
file:myapp/*.json
file:myapp/*.*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader added in v2.0.2

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

Loader loads configuration layers from YAML, JSON and TOML configuration files.

func NewLoader

func NewLoader(dirs ...string) *Loader

NewLoader method creates new loader instance. Method accepts a list of directories, in which the loader will search configuration files. The merge priority of loaded configuration layers depends on the order of directories. Layers loaded from rightmost directory have highest priority.

func (*Loader) Load added in v2.0.2

func (l *Loader) Load(pattern string) ([]any, error)

Load method loads configuration layer from YAML, JSON and TOML configuration files.

Jump to

Keyboard shortcuts

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