config

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	APIEndpoint string `env:"API_ENDPOINT" json:"endpoint"`
}

APIConfig from marudor api

type Config

type Config struct {
	APIConfig APIConfig      `json:"api"`
	Database  DatabaseConfig `json:"database"`
	Telegram  TelegramConfig `json:"telegram"`
	LogLevel  string         `env:"LOG_LEVEL" json:"loglevel"`
}

Config contains the complete service configuration

func NewTestConfig

func NewTestConfig() *Config

NewTestConfig return a config object with test settings

func ReadConfig

func ReadConfig(file string, log *logrus.Entry) *Config

ReadConfig reads a json file and overwrite with ENV vars

type DatabaseConfig

type DatabaseConfig struct {
	Dialect string `env:"DB_DIALECT" json:"dialect"`
	Path    string `env:"DB_PATH" json:"path"`
}

DatabaseConfig connection data

type TelegramConfig

type TelegramConfig struct {
	Key string `env:"TELEGRAM_KEY" json:"key"`
}

TelegramConfig for the bot

Jump to

Keyboard shortcuts

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