config

package
v0.0.0-...-e9c9027 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT, MIT Imports: 0 Imported by: 0

Documentation

Overview

* @File: config.config.go * @Description: Defines common service configuration * @Author: Yoan Yomba (yoanyombapro@gmail.com)

Index

Constants

View Source
const (
	ErrNameEmpty      = "Name is empty"
	ErrPasswordEmpty  = "Password is empty"
	ErrNotObjectIDHex = "String is not a valid hex representation of an ObjectId"
)

Status Text

View Source
const (
	StatusCodeUnknown = -1
	StatusCodeOK      = 1000
)

Status Code

Variables

This section is empty.

Functions

func DefaultConfiguration

func DefaultConfiguration()

DefaultConfiguration provides a default configuration object

Types

type AmqpConfiguration

type AmqpConfiguration struct {
	ServerUrl string `arg:"env:AMQP_SERVER_URL"`
}

AmqpConfiguration witholds connections parameters for a rabbitMQ instance

type Configuration

type Configuration struct {
	ServerConfiguration
	AmqpConfiguration
}

Configuration stores setting values

var (
	Config *Configuration
)

Config shares the global configuration

func (*Configuration) GetDatabaseConnectionString

func (Config *Configuration) GetDatabaseConnectionString() string

GetDatabaseConnectionString Creates a database connection string from the service configuration settings

type ServerConfiguration

type ServerConfiguration struct {
	Port           string `arg:"env:SERVER_PORT"`
	Name           string `arg:"env:SERVICE_NAME`
	Debug          string `arg:"env:DEBUG_ADDR"`
	Http           string `arg:"env:HTTP_ADDR"`
	Appdash        string `arg:"env:APPDASH_ADDR"`
	ZipkinUrl      string `arg:"env:ZIPKIN_URL"`
	UseZipkin      bool   `arg:"env:ZIPKIN_USE"`
	Zipkin         string `arg:"env:ZIPKIN_ADDR"`
	DbType         string `arg:"env:DB_TYPE"`
	DbAddress      string `arg:"env:DB_ADDRESS"`
	DbName         string `arg:"env:DB_NAME"`
	DbSettings     string `arg:"env:DB_SETTINGS"`
	Development    bool   `arg:"env:DEVELOPMENT"`
	Jwt            string `arg:"env:JWTSECRETPASSWORD"`
	Issuer         string `arg:"env:ISSUER"`
	ZipkinBridge   bool   `arg:"env:ZIPKINBRIDGE"`
	LightstepToken string `arg:"env:LIGHTSTEP"`
}

ServerConfiguration witholds important parameters such as ports and service names

Jump to

Keyboard shortcuts

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