config

package
v0.0.0-...-eefcb69 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConfig

type CSVConfig struct {
	DataDir  string `yaml:"datadir"`
	Interval int    `yaml:"intervalmin"`
}

type Config

type Config struct {
	Server    ServerConfig    `yaml:"server"`
	Messaging MessagingConfig `yaml:"messaging"`
	CSV       CSVConfig       `yaml:"csv"`
	Telegram  TelegramConfig  `yaml:"telegram"`
}

Config the configuration of this service

func InitConfig

func InitConfig(configFile string) (cfg *Config, err error)

InitConfig initialize the configuration

type MessagingConfig

type MessagingConfig struct {
	Host         string `yaml:"host" envconfig:"MQ_HOST"`
	Port         string `yaml:"port" envconfig:"MQ_PORT"`
	StripTopic   string `yaml:"striptopic" envconfig:"MQ_STRIPTOPIC"`
	ProfileTopic string `yaml:"profiletopic" envconfig:"MQ_STRIPTOPIC"`
	Disabled     bool   `yaml:"disabled" envconfig:"MQ_DISABLED"`
}

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host" envconfig:"SERVER_HOST"`
	Port string `yaml:"port" envconfig:"SERVER_PORT"`
	Mode string `yaml:"mode" envconfig:"SERVER_MODE"`
}

type TelegramConfig

type TelegramConfig struct {
	Enable         bool    `yaml:"enable" envconfig:"TG_ENABLE"`
	EnableDebug    bool    `yaml:"enabledebug" envconfig:"TG_ENABLE_DEBUG"`
	BotKey         string  `yaml:"apikey" envconfig:"TG_BOT_APIKEY"`
	AllowedUserIDs []int64 `yaml:"allowedusers" envconfig:"TG_ALLOWED_USERS"`
}

Jump to

Keyboard shortcuts

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