configs

package
v0.0.0-...-fca878f Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Application the app name
	Application = "Building API Service"
	// BuildTime is a time label of the moment when the binary was built
	BuildTime = ""
	// Commit is a last commit hash at the moment when the binary was built
	Commit = ""
	// Release is a semantic version of current build
	Release = ""
	// APIVersion is the app ver string
	APIVersion = ""
)

Functions

This section is empty.

Types

type APISettings

type APISettings struct {
	Config    *ParameterConfig
	CmdParams string
}

APISettings is a config mapping

var (
	//Settings of the app
	Settings *APISettings
)

func NewAppSettings

func NewAppSettings(setters ...Setup) *APISettings

NewAppSettings main entry for config

func (*APISettings) FormatParameterConfig

func (g *APISettings) FormatParameterConfig(s string) *ParameterConfig

FormatParameterConfig new ParameterConfig

func (*APISettings) InitEnvParams

func (g *APISettings) InitEnvParams()

InitEnvParams enable all OS envt vars to reload internally

func (*APISettings) InitRecov

func (g *APISettings) InitRecov()

InitRecov is for dumpIng segv in

func (*APISettings) Initializer

func (g *APISettings) Initializer()

Initializer set defaults for initial reqmts

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option optional parameter structure

func NewOption

func NewOption(name string, value interface{}) *Option

NewOption new Option

func (*Option) Name

func (o *Option) Name() string

Name of the Option

func (*Option) Value

func (o *Option) Value() interface{}

Value of the Option

type ParameterConfig

type ParameterConfig struct {
	Port    string `json:"port"`
	DSN     string `json:"dsn"`
	Verbose bool   `json:"showlog"`
}

ParameterConfig optional parameter structure

type Setup

type Setup func(*APISettings)

Setup options settings

func WithSetupCmdParams

func WithSetupCmdParams(r string) Setup

WithSetupCmdParams for the json params

func WithSetupConfig

func WithSetupConfig(r *ParameterConfig) Setup

WithSetupConfig for cfg

Jump to

Keyboard shortcuts

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