config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config has weakness because of lenCaller.

Gobase.Start must be called in the same path with the config folder. It is a fragile assumption, but worth it. Because Gobase is made for personal simplicity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Stage string
	YAML  map[string]interface{}
}

Config public

func Get

func Get() *Config

Get retrieves config

func Set

func Set(realativeDepth string) *Config

Set sets and retrieves Config from yaml files on config directory.

relativeDepth format follows '.', '..', '../..'... The name of the yaml file is determined by an environment variable whose key is 'STAGE'. If there is no environment variable, 'local' is selected by default. (e.g. 'local.yaml')

func SetWithCallerLength

func SetWithCallerLength(callerLength int, relativeDepth string) *Config

SetWithCallerLength is same as Set but requires an extra caller length.

Jump to

Keyboard shortcuts

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