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 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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.