config

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 7 Imported by: 5

README

Config component for Enorith

Basic usage

package main

import (
    "github.com/enorith/config"
)
type FooConfig struct {
    // load yaml config, fallback environment variable
    Foo string `env:"ENV_FOO"`
}



func main() {
    var c FooConfig
    config.Unmarshal("config.yml", &c)
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvPrefix = ""

Functions

func Unmarshal

func Unmarshal(file string, out interface{}) error

func UnmarshalBytes

func UnmarshalBytes(data []byte, out interface{}) error

func UnmarshalEnv

func UnmarshalEnv(config interface{})

func UnmarshalFS

func UnmarshalFS(fsys fs.FS, filename string, out interface{}) error

func UnmarshalNode

func UnmarshalNode(node yaml.Node, out interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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