configapp

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package configapp provides configuration management for awslogcheck.

Index

Constants

View Source
const RULESDIR = "rules"

RULESDIR is the default directory name for rule files.

Variables

View Source
var (
	ErrRulesDirNotFound = errors.New("rules directory not found")
)

Static errors for wrapping.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	RulesDir              string            `yaml:"rulesdir"`
	ImagesToIgnore        []string          `yaml:"imagesToIgnore"`
	ContainerNameToIgnore []string          `yaml:"containerNameToIgnore"`
	SMTPConfig            smtpConfig        `yaml:"smtp"`
	MailgunConfig         MailGunConfig     `yaml:"mailgun"`
	MailConfig            MailConfiguration `yaml:"mailconfiguration"`
	AwsRegion             string            `yaml:"aws_region"`
	LogGroup              string            `yaml:"loggroup"`
	DebugLevel            string            `yaml:"debuglevel"`
}

AppConfig represents the application configuration.

func ReadYamlCnxFile

func ReadYamlCnxFile(filename string) (AppConfig, error)

ReadYamlCnxFile reads and parses a YAML configuration file.

func (*AppConfig) GetRulesDir

func (a *AppConfig) GetRulesDir() (string, error)

GetRulesDir returns path of rules directory. If empty, return the path of the binary/rules.

func (*AppConfig) IsMailGunConfigured

func (a *AppConfig) IsMailGunConfigured() bool

IsMailGunConfigured checks if Mailgun is properly configured.

func (*AppConfig) IsSMTPConfigured added in v0.6.2

func (a *AppConfig) IsSMTPConfigured() bool

IsSMTPConfigured checks if SMTP is properly configured.

type MailConfiguration

type MailConfiguration struct {
	FromEmail string `yaml:"from_email"`
	// realname: Production
	Sendto  string `yaml:"sendto"`
	Subject string `yaml:"subject"`
}

MailConfiguration contains email configuration settings.

type MailGunConfig

type MailGunConfig struct {
	Domain string `yaml:"domain"`
	APIKey string `yaml:"apikey"`
}

MailGunConfig contains Mailgun-specific configuration.

Jump to

Keyboard shortcuts

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