config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init function to setup config paths and ENV binding. Should just be called once.

func Load

func Load() error

Loads the config with Viper into a Struct and validates it

func SetDefaultValues

func SetDefaultValues()

This sets the default config values. Should just be called once.

Types

type Config

type Config struct {
	FirstVersion  string `mapstructure:"first_version" validate="required"`
	GitExecutable string `mapstructure:"git_executable" validate="required"`
	GitRemote     string `mapstructure:"git_remote" validate="required"`
	GitRepoUrl    string `mapstructure:"git_repo_url"`
	NewVersion    string `mapstructure:"new_version"`
	LatestVersion string `mapstructure:"latest_version"`
}

Application config data struct

var (
	// Global config instance
	Cfg *Config
)

func Get

func Get() *Config

Returns the current global instance of Config

Jump to

Keyboard shortcuts

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