config

package
v0.0.0-...-fc29ad5 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 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 ConfigNotification

type ConfigNotification struct {
	SecretKeyHeader string                     `koanf:"secret_key_header"`
	Telegram        ConfigNotificationTelegram `koanf:"telegram"`
	Discord         ConfigNotificationDiscord  `koanf:"discord"`
	Email           ConfigNotificationEmail    `koanf:"email"`
	SendGrid        ConfigNotificationSendGrid `koanf:"sendgrid"`
	MSTeams         ConfigNotificationMSTeams  `koanf:"msteams"`
}

type ConfigNotificationDiscord

type ConfigNotificationDiscord struct {
	BotToken   string   `koanf:"bot_token"`
	OAuthToken string   `koanf:"oauth_token"`
	ChannelIDs []string `koanf:"channel_ids"`
}

type ConfigNotificationEmail

type ConfigNotificationEmail struct {
	Sender     string   `koanf:"sender"`
	Server     string   `koanf:"server"`
	Port       int      `koanf:"port"`
	Username   string   `koanf:"username"`
	Password   string   `koanf:"password"`
	Recipients []string `koanf:"recipients"`
}

type ConfigNotificationMSTeams

type ConfigNotificationMSTeams struct {
	Webhooks []string `koanf:"webhooks"`
}

type ConfigNotificationSendGrid

type ConfigNotificationSendGrid struct {
	APIKey        string   `koanf:"api_key"`
	SenderAddress string   `koanf:"sender_address"`
	SenderName    string   `koanf:"sender_name"`
	Recipients    []string `koanf:"recipients"`
}

type ConfigNotificationTelegram

type ConfigNotificationTelegram struct {
	APIToken string  `koanf:"api_token"`
	ChatIDs  []int64 `koanf:"chat_ids"`
}

type ConfigServer

type ConfigServer struct {
	Listen          string        `koanf:"listen"`
	PprofListen     string        `koanf:"listen_pprof"`
	GracefulTimeout time.Duration `koanf:"graceful_timeout"`
	RootCA          string        `koanf:"root_ca"`
	CertSubject     string        `koanf:"cert_subject"`
}

type Configuration

type Configuration struct {
	Server         ConfigServer       `koanf:"server"`
	Notifications  ConfigNotification `koanf:"notifications"`
	Timeout        time.Duration      `koanf:"timeout"`
	Cloudflare     bool               `koanf:"cloudflare"`
	PandocPath     string             `koanf:"pandoc_path"`
	PandocDataDir  string             `koanf:"pandoc_data_dir"`
	CommandTimeout time.Duration      `koanf:"command_timeout"`
}

func GetConfig

func GetConfig(f string) (Configuration, error)

Jump to

Keyboard shortcuts

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