configuration

package
v0.0.0-...-e7ab01c Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Struct

type Struct struct {
	Database struct {
		User     string `json:"user"`
		Password string `json:"password"`
		Host     string `json:"host"`
		Database string `json:"database"`
		Port     int    `json:"port"`
	} `json:"database"`
	Consul struct {
		ACL  string `json:"acl"`
		Host string `json:"host"`
		Port int    `json:"port"`
	} `json:"consul"`
	LogLevel string `json:"loglevel"`
}

Struct that represents the configuration

func GetConfig

func GetConfig(f string) *Struct

GetConfig reads the configuration from a configuration file and returns a configuration struct

func (*Struct) OverwriteConfig

func (c *Struct) OverwriteConfig(cli *cli.Context)

OverwriteConfig updates the configuration with cli context

func (*Struct) PrintDebug

func (c *Struct) PrintDebug() string

PrintDebug returns a string representation of the configuration

func (*Struct) ValidateConfiguration

func (c *Struct) ValidateConfiguration() error

ValidateConfiguration validates a given configuration

Jump to

Keyboard shortcuts

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