config

package
v0.0.0-...-115e79b Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Telegram Telegram `mapstructure:"telegram"`
	SendGrid SendGrid `mapstructure:"sendgrid"`
	InfluxDB InfluxDB `mapstructure:"influxdb"`
}

Config

func ReadFromFile

func ReadFromFile() (*Config, error)

ReadFromFile to read config details using viper

func (*Config) Validate

func (c *Config) Validate(e ...string) error

Validate config struct

type InfluxDB

type InfluxDB struct {
	Port     string `mapstructure:"port"`
	Database string `mapstructure:"database"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

InfluxDB details

type SendGrid

type SendGrid struct {
	Token        string `mapstructure:"sendgrid_token"`
	EmailAddress string `mapstructure:"email_address"`
}

SendGrid tokens

type Telegram

type Telegram struct {
	BotToken string `mapstructure:"tg_bot_token"`
	ChatID   int64  `mapstructure:"tg_chat_id"`
}

Telegram bot details struct

Jump to

Keyboard shortcuts

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