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.

Typical usage:

cfg := config.Must(file.NewConfig(fileName, 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(name string, encoder config.Encoder) (*config.Config, error)

NewConfig function creates new configuration service using data in some file as a source and chosen encoder. Most likely you will use one of the predefined encoders: json.Encoder, yaml.Encoder or toml.Encoder.

Types

This section is empty.

Jump to

Keyboard shortcuts

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