file

package
v0.0.0-...-93b1e75 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package file is a wrapper around config package and allows reading configuration from some file on disk and parsing it with some encoder, where file name is defined in environment variable.

Used environment variables: CONFIG_FILE - configuration file name. Default is 'configs/config.<encoder>'.

Typical usage:

cfg := config.Must(file.NewConfig(encoder))

err = cfg.Get(&myStructure)
if err != nil {
    panic(err)
}

See config package for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(encoder config.Encoder) (*config.Config, error)

NewConfig function creates new configuration service from file. Use CONFIG_FILE environment variable to define configuration file name. Default is 'configs/config.<encoder>'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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