config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileEnvKey  string = "BEAP_CONFIG"
	DefaultConfigDir  string = "configs"
	DefaultConfigFile string = "app"
	DefaultConfigType string = "yml"
	ExtensionSep      string = "."
	ConfigReadError   string = "Couldn't read config file"
)

Configuration related constants

Variables

This section is empty.

Functions

func AbsConfigPath

func AbsConfigPath(filename string, projectPath string, relPath string) string

AbsConfigPath ...

func Bootstrap

func Bootstrap(appName string, projectPath string)

Bootstrap ...

func EnvConfigFile

func EnvConfigFile() string

EnvConfigFile extracts the value associated with the environment variable that specifies which config file to use when starting up a system.

func Extension2Type

func Extension2Type(ext string) string

Extension2Type ...

func SetConfiguration added in v0.5.0

func SetConfiguration(opts *Options)

SetConfiguration ...

func Setup

func Setup(appName string, projectPath string, filepath string)

Setup ...

Types

type Options

type Options struct {
	AbsPath     string // The absolute path to the config file
	AppName     string
	ConfigDir   string
	File        string // The name of the config file, minus any path or extension
	ProjectPath string // The absolute path to the project being configured
	RelPath     string // The relative path to the config file
	Type        string // The config file type, usually extension
}

Options for use in configuration functions

func ParseConfigFilename

func ParseConfigFilename(filename string, projectPath string) *Options

ParseConfigFilename takes a given string and parses it as a filename, separating prefix directories, name of file, and file extension.

Jump to

Keyboard shortcuts

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