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

config

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 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
	Lark      LarkConfig
}

type AwsIncidentManagerConfig

type AwsIncidentManagerConfig struct {
	ResponsePlanArn       string            `mapstructure:"response_plan_arn"`
	OtherResponsePlanArns map[string]string `mapstructure:"other_response_plan_arns"`
}

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 LarkConfig added in v1.3.1

type LarkConfig struct {
	Enable           bool
	WebhookURL       string            `mapstructure:"webhook_url"`
	TemplatePath     string            `mapstructure:"template_path"`
	OtherWebhookURLs map[string]string `mapstructure:"other_webhook_urls"`
}

type MSTeamsConfig

type MSTeamsConfig struct {
	Enable         bool
	TemplatePath   string            `mapstructure:"template_path"`
	OtherPowerURLs map[string]string `mapstructure:"other_power_urls"` // 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"`
	Provider           string                   `mapstructure:"provider"` // "aws_incident_manager" or "pagerduty"
	AwsIncidentManager AwsIncidentManagerConfig `mapstructure:"aws_incident_manager"`
	PagerDuty          PagerDutyConfig          `mapstructure:"pagerduty"`
}

type PagerDutyConfig added in v1.3.0

type PagerDutyConfig struct {
	RoutingKey       string            `mapstructure:"routing_key"`
	OtherRoutingKeys map[string]string `mapstructure:"other_routing_keys"`
}

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"`
	MessageProperties SlackMessageProperties `mapstructure:"message_properties"`
}

type SlackMessageProperties added in v1.3.3

type SlackMessageProperties struct {
	DisableButton bool   `mapstructure:"disable_button"`
	ButtonText    string `mapstructure:"button_text"`
	ButtonStyle   string `mapstructure:"button_style"`
}

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