configsetup

package
v0.0.0-...-f64704c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureManagement

func ConfigureManagement() (targetConfig config.Config, err error)

ConfigureManagement Load configuration and setup the mananagement database

func LoadConfig

func LoadConfig(configURL, configFile string) (targetConfig config.Config, err error)

LoadConfig Load a configuration from URL and fallback to filepath if URL is not supplied. If the URL fails to return a valid configration an error is returned.

func SetConfigFile

func SetConfigFile(cFile string)

SetConfigFile Set the file used for local configuration

func SetConfigURL

func SetConfigURL(cURL string)

SetConfigURL Set the URL used for remote configuration

Types

type Health

type Health struct {
	Checks []HealthCheck
	// contains filtered or unexported fields
}

Health Stores the result of all checks

func CheckConfig

func CheckConfig(log bool) (checks Health)

CheckConfig Check the current configuration for issues

func GetHealth

func GetHealth() Health

GetHealth Get a Health instance

func (*Health) AddCheck

func (h *Health) AddCheck(hc HealthCheck)

AddCheck Add a HealthCheck

func (*Health) AddFail

func (h *Health) AddFail(details string)

AddFail Helper function for adding a failing check

func (*Health) AddFailValue

func (h *Health) AddFailValue(details string, result int)

AddFailValue Helper function for adding a failing check with a fail value

func (*Health) AddPass

func (h *Health) AddPass(details string)

AddPass Helper function for adding a passing check

func (Health) Display

func (h Health) Display()

Display Print health checks to the console

func (Health) Ok

func (h Health) Ok() bool

Ok All checks passing

type HealthCheck

type HealthCheck struct {
	Details string
	Result  int
}

HealthCheck Stores basic information about a check

Jump to

Keyboard shortcuts

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