Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string) error

Types

type AlertConfig

type AlertConfig struct {
	DebugBody bool `mapstructure:"debug_body"`
	Slack     SlackConfig
	Telegram  TelegramConfig
	Email     EmailConfig
	MSTeams   MSTeamsConfig
}

type AwsIncidentManagerConfig

type AwsIncidentManagerConfig struct {
	ResponsePlanArn string `mapstructure:"response_plan_arn"`
}

type AzBusConfig

type AzBusConfig struct {
	Enable bool `mapstructure:"enable"`
}

type Config

type Config struct {
	Name       string
	Host       string
	Port       int
	PublicHost string `mapstructure:"public_host"`

	Alert  AlertConfig
	Queue  QueueConfig
	OnCall OnCallConfig

	Redis RedisConfig `mapstructure:"redis"`
}

func GetConfig

func GetConfig() *Config

func GetConfigWitParamsOverwrite

func GetConfigWitParamsOverwrite(paramsOverwrite *map[string]string) *Config

type EmailConfig

type EmailConfig struct {
	Enable       bool
	SMTPHost     string `mapstructure:"smtp_host"`
	SMTPPort     string `mapstructure:"smtp_port"`
	Username     string
	Password     string
	To           string
	Subject      string
	TemplatePath string `mapstructure:"template_path"`
}

type MSTeamsConfig

type MSTeamsConfig struct {
	Enable        bool
	TemplatePath  string            `mapstructure:"template_path"`
	OtherPowerURL map[string]string `mapstructure:"other_power_url"` // Optional alternative Power Automate URLs
	// Power Automate Workflow URL for Teams integration
	PowerAutomateURL string `mapstructure:"power_automate_url"`
}

type OnCallConfig

type OnCallConfig struct {
	Enable             bool
	WaitMinutes        int                      `mapstructure:"wait_minutes"`
	AwsIncidentManager AwsIncidentManagerConfig `mapstructure:"aws_incident_manager"`
}

type PubSubConfig

type PubSubConfig struct {
	Enable bool `mapstructure:"enable"`
}

type QueueConfig

type QueueConfig struct {
	Enable    bool         `mapstructure:"enable"`
	DebugBody bool         `mapstructure:"debug_body"`
	SNS       SNSConfig    `mapstructure:"sns"`
	SQS       SQSConfig    `mapstructure:"sqs"`
	PubSub    PubSubConfig `mapstructure:"pubsub"`
	AzBus     AzBusConfig  `mapstructure:"azbus"`
}

type RedisConfig

type RedisConfig struct {
	Host               string `mapstructure:"host"`
	Port               int    `mapstructure:"port"`
	Password           string `mapstructure:"password"`
	DB                 int    `mapstructure:"db"`
	InsecureSkipVerify bool   `mapstructure:"insecure_skip_verify"`
}

type SNSConfig

type SNSConfig struct {
	Enable       bool   `mapstructure:"enable"`
	TopicARN     string `mapstructure:"topic_arn"`
	Endpoint     string `mapstructure:"https_endpoint_subscription"`
	EndpointPath string `mapstructure:"https_endpoint_subscription_path"`
}

type SQSConfig

type SQSConfig struct {
	Enable   bool   `mapstructure:"enable"`
	QueueURL string `mapstructure:"queue_url"`
}

type SlackConfig

type SlackConfig struct {
	Enable       bool
	Token        string
	ChannelID    string `mapstructure:"channel_id"`
	TemplatePath string `mapstructure:"template_path"`
}

type TelegramConfig

type TelegramConfig struct {
	Enable       bool
	BotToken     string `mapstructure:"bot_token"`
	ChatID       string `mapstructure:"chat_id"`
	TemplatePath string `mapstructure:"template_path"`
}

Jump to

Keyboard shortcuts

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