utils

package
v0.0.0-...-402fc94 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_ACTIVE_SOURCE_TIMEOUT = 60
View Source
const DEFAULT_DB_TIMEOUT_MS = 5000
View Source
const DEFAULT_DEACTIVATOR_INTERVAL_MINS = 10
View Source
const DEFAULT_LIBRARY_TOKEN_EXPIRE_MINS = 30
View Source
const DEFAULT_PORT = 443

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	Token                          string `toml:"token" validate:"required"`
	WebhookURL                     string `toml:"webhookUrl" validate:"required"`
	CertFilePath                   string `toml:"certFile" validate:"required"`
	PrivKeyFilePath                string `toml:"privKeyFile" validate:"required"`
	LogPath                        string `toml:"logPath" validate:"required"`
	IsDev                          bool   `toml:"isDev"`
	DefaultActiveSourceTimeoutMins int    `toml:"defaultActiveSourceTimeoutMins" validate:"gte=0"`
	DeactivatorIntervalMins        int    `toml:"deactivatorIntervalMins" validate:"gte=0"`
	Port                           int    `toml:"port" validate:"gte=0"`
	LibraryTokenExpireMins         int    `toml:"libraryTokenExpireMins" validate:"gte=0"`
}

type Config

type Config struct {
	Db  *DBConfig  `toml:"db" validate:"required"`
	Bot *BotConfig `toml:"bot" validate:"required"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type DBConfig

type DBConfig struct {
	URL       string `toml:"url" validate:"required"`
	TimeoutMs int    `toml:"timeoutMs" validate:"gte=0"`
}

Jump to

Keyboard shortcuts

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