configuration

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestConfigPath string

TestConfigPath is file path used for unit tests.

Functions

func LoadConfiguration

func LoadConfiguration()

LoadConfiguration is for loading config from files and environment and setting it ready to be read.

Types

type Config

type Config struct {
	Application struct {
		Name        string `default:"eve-graphql-go" yaml:"name"`
		Environment string `default:"production" yaml:"environment"`
	} `yaml:"application"`
	Server struct {
		Port string `default:"8080" yaml:"port"`
	} `yaml:"server"`
	Caching struct {
		Impl string `default:"memory" yaml:"impl"`
	} `yaml:"cache"`
	Redis struct {
		URL      string `default:"localhost" yaml:"url"`
		Port     string `default:"30893" yaml:"port"`
		User     string `default:"" yaml:"user"`
		Password string `default:"" yaml:"password"`
	} `yaml:"redis"`
	Esi struct {
		Default struct {
			QueryParams []KeyValue `yaml:"queryParams"`
			URL         string     `default:"https://esi.evetech.net/latest" yaml:"url"`
		} `yaml:"default"`
	} `yaml:"esi"`
	Jaeger struct {
		Enabled  bool   `default:"false" yaml:"enabled"`
		Hostname string `default:"localhost" yaml:"hostname"`
		Port     string `default:"14268" yaml:"port"`
		Protocol string `default:"http" yaml:"protocol"`
		Route    string `default:"api/traces" yaml:"route"`
		Sample   struct {
			Percent int `default:"0" yaml:"percent"`
		} `yaml:"sample"`
	} `yaml:"jaeger"`
}

Config is a struct in yaml format for storing configs for the application.

var AppConfig Config

AppConfig is the package level variable exposing the applications configs.

type KeyValue added in v0.0.2

type KeyValue struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

KeyValue is a struct for representing simple Key Value pairs of configs.

Jump to

Keyboard shortcuts

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