config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config provides config-data. The most-basic information is to be injected at compile-time. Otherwise, this package stops execution with an error, when Load is called. The other configuration-options are loaded from a config.ini-file, that is located at ConfigPath, when the Load() function is called

Index

Constants

View Source
const ConfigDependant = "CONFIG-DEPENDANT"

ConfigDependant is a string-flag signalizing, that a cli flag depends on which config-file is used

Variables

View Source
var BuildTime string

BuildTime must be injected using the makefile. It is attached to the version command- and request-output

View Source
var ConfigPath string

ConfigPath must be injected using the makefile. It holds the path to the config-file used, if not specified otherwise via the cli

View Source
var GitCommit string

GitCommit must be injected using the makefile. It is attached to the version command- and request-output

View Source
var IsTest bool

IsTest is a flag, that should be set when running tests. If set, this package won't panic, if the following variables were not injected at compile-time

View Source
var Version string

Version must be injected using the makefile. If its value is set to "develop" this server operates in development-mode, if not specified otherwise via the cli. The Version is attached to the version command- and request-output

Functions

func Load

func Load(ctx *cli.Context) error

Load updates that part of the configuration-data, which is derived from the config-file located at ConfigPath

func Options

func Options() []cli.Flag

Options returns a list of flags for the cli, which represent the configuration-options of the config-file

Types

type SSLConfig

type SSLConfig struct {
	CertificatePath string `ini:"path"`
}

SSLConfig holds the path to the ssl-certificate

var SSL *SSLConfig

SSL holds the path to the ssl-certificate

type ServerConfig

type ServerConfig struct {
	IP   string `ini:"ip"`
	Port int    `ini:"port"`
	// (production = 1; development = 2)
	Mode int `ini:"mode"`
	// add "*", if you want to allow any origin
	AllowedRequestOrigins []string `ini:"allowed_request_origins"`
}

ServerConfig holds the local ip and port and, whether the server runs in production or development mode

var Server *ServerConfig

Server holds the local ip and port and, whether the server runs in production or development mode

type StreamBaseConfig

type StreamBaseConfig struct {
	SupplierTimeout time.Duration `ini:"suppliertimeout"`
	StreamTimeout   time.Duration `ini:"streamtimeout"`
}

StreamBaseConfig holds the inactivity-timeouts for Streams and StreamSources

var StreamBase *StreamBaseConfig

StreamBase holds the inactivity-timeouts for Streams and StreamSources

Jump to

Keyboard shortcuts

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