config

package
v0.0.0-...-09a68ad Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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 AQICN

type AQICN struct {
	City  string `json:"city" default:"ho-chi-minh-city"`
	Token string `json:"token"`
}

type Bot

type Bot struct {
	Secret      string      `json:"secret" required:"true"`
	Token       string      `json:"token" required:"true"`
	Translation Translation `json:"translation"`
	Weather     Weather     `json:"weather"`
	AQI         AQICN       `json:"aqi"`
	Joke        Joke        `json:"joke"`
}

type Config

type Config struct {
	Port     string   `json:"port" required:"true"`
	LogLevel string   `json:"log_level" default:"info"`
	Bot      Bot      `json:"bot"`
	Database Database `json:"database"`
}

func LoadEnvConfig

func LoadEnvConfig() (*Config, error)

type Database

type Database struct {
	Type    string  `json:"type" required:"true" default:"mongodb"`
	MongoDB MongoDB `json:"mongo_db"`
}

type Joke

type Joke struct {
	Folder string `json:"folder" default:"_misc"`
}

type MongoDB

type MongoDB struct {
	URI string `json:"uri" envconfig:"URI"`
}

type OpenWeatherMap

type OpenWeatherMap struct {
	City  string `json:"city"`
	Token string `json:"token"`
}

type Translation

type Translation struct {
	SourceLang string `json:"source_language" default:"auto"`
	TargetLang string `json:"target_language" default:"en"`
}

type Weather

type Weather struct {
	Type        string         `json:"type" default:"openweathermap"`
	OpenWeather OpenWeatherMap `json:"open_weather"`
}

Jump to

Keyboard shortcuts

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