config

package
v0.22.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

type Calendar struct {
	Name string `toml:"name"`
}

Calendar struct hold Google Calendar configuration.

type Discord

type Discord struct {
	Token   string   `toml:"token"`
	UserIDs []string `toml:"userids"`
}

Discord struct holds Discord messenger configuration.

type Mail

type Mail struct {
	Server   string   `toml:"server"`
	Port     string   `toml:"port"`
	Username string   `toml:"username"`
	Password string   `toml:"password"`
	From     string   `toml:"from"`
	Subject  string   `toml:"subject"`
	To       []string `toml:"to"`
}

Mail struct hold mail messenger configuration.

type Slack

type Slack struct {
	Token   string   `toml:"token"`
	ChatIDs []string `toml:"chatids"`
}

Slack struct holds Slack messenger configuration.

type Telegram

type Telegram struct {
	Token   string   `toml:"token"`
	ChatIDs []string `toml:"chatids"`
}

Telegram struct holds Telegram messenger configuration.

type TomlConfig

type TomlConfig struct {
	Calendar        Calendar `toml:"calendar"`
	Mail            Mail     `toml:"mail"`
	Telegram        Telegram `toml:"telegram"`
	Discord         Discord  `toml:"discord"`
	Slack           Slack    `toml:"slack"`
	User            []User   `toml:"user"`
	WhatsApp        WhatsApp `toml:"whatsapp"`
	TelegramEnabled bool     `toml:"telegram_enabled"`
	DiscordEnabled  bool     `toml:"discord_enabled"`
	SlackEnabled    bool     `toml:"slack_enabled"`
	MailEnabled     bool     `toml:"mail_enabled"`
	CalendarEnabled bool     `toml:"calendar_enabled"`
	WhatsAppEnabled bool     `toml:"whatsapp_enabled"`
}

TomlConfig struct holds all other configuration structures.

func LoadConfig

func LoadConfig(file string) (TomlConfig, error)

LoadConfig attempts to load and decode configuration file in TOML format, doing a minimal sanity checking and optionally returning an error.

type User

type User struct {
	Username string `toml:"username"`
	Password string `toml:"password"`
}

User struct holds a single AAI/SSO username.

type WhatsApp

type WhatsApp struct {
	PhoneNumber string   `toml:"phonenumber"`
	UserIDs     []string `toml:"userids"`
	Groups      []string `toml:"groups"`
}

WhatsApp struct holds WhatsApp messenger configuration.

Jump to

Keyboard shortcuts

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