config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 10 Imported by: 2

README

Config

Documentation

Overview

config package from micro-strter-kit import myConfig "github.com/xmlking/micro-starter-kit/shared/config" to `main.go` and all test files. then use Helper Methods `config.GetServiceConfig()` anywhere you need to retrieve `Configuration`

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	Configor *configor.Configor

	// Version is populated by govvv in compile-time.
	Version = "untouched"
	// BuildDate is populated by govvv.
	BuildDate string
	// GitCommit is populated by govvv.
	GitCommit string
	// GitBranch is populated by govvv.
	GitBranch string
	// GitState is populated by govvv.
	GitState string
	// GitSummary is populated by govvv.
	GitSummary string
)

Functions

func CreateServerCerts added in v0.3.2

func CreateServerCerts() (tlsConfig *tls.Config, err error)

func GetBuildInfo

func GetBuildInfo() string

func GetConfig added in v0.3.2

func GetConfig() configPB.Configuration
Example
package main

import (
	"fmt"

	"github.com/xmlking/micro-starter-kit/shared/config"
)

func main() {
	fmt.Println(config.GetConfig().Email)
	// fmt.Println(config.GetConfig().Services["account"].Deadline)

}
Output:

username:"yourGmailUsername" password:"yourGmailAppPassword" email_server:"smtp.gmail.com" port:587 from:"xmlking-test@gmail.com"
Example (Check_defaults)
package main

import (
	"fmt"

	"github.com/xmlking/micro-starter-kit/shared/config"
)

func main() {
	fmt.Println(config.GetConfig().Services.Account.Endpoint)
	fmt.Println(config.GetConfig().Services.Account.Version)
	fmt.Println(config.GetConfig().Services.Account.Deadline)

}
Output:

mkit.service.account:8080
v0.1.0
8888

func IsProduction

func IsProduction() bool

*

Helper Functions

Types

This section is empty.

Jump to

Keyboard shortcuts

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