app

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: 21 Imported by: 0

Documentation

Overview

Package app provides the core application logic for awslogcheck.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRulesFolder     = errors.New("no rules folder found")
	ErrLogGroupNotFound  = errors.New("log group not found")
	ErrRulesDirNotFound  = errors.New("rules directory not found")
	ErrServiceNotConfig  = errors.New("service not configured")
	ErrSMTPConfigMissing = errors.New("smtp configuration missing")
	ErrSMTPServerFormat  = errors.New("smtp server format should be: host:port")
)

Static errors for wrapping.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents the main application structure.

func New

func New(_ context.Context, cfg configapp.AppConfig, awscfg aws.Config, lastPeriodToWatch int, log *slog.Logger) *App

New creates a new App instance.

func (*App) GetLogger added in v0.6.1

func (a *App) GetLogger() *slog.Logger

GetLogger returns the logger instance.

func (*App) GetTimeStampMsRangeofLastHour

func (a *App) GetTimeStampMsRangeofLastHour() (int64, int64, error)

GetTimeStampMsRangeofLastHour returns timestamps for the last hour in milliseconds.

func (*App) LoadRules

func (a *App) LoadRules() error

LoadRules loads regexp rules that will be used to ignore events (log).

func (*App) LogCheck

func (a *App) LogCheck(ctx context.Context) error

LogCheck performs the main log checking process.

func (*App) PrintMemoryStats

func (a *App) PrintMemoryStats(stop <-chan interface{})

PrintMemoryStats prints memory statistics periodically until stopped.

func (*App) SendReport

func (a *App) SendReport(freport string) error

SendReport sends the report file via email using configured mail service.

type CloudWatchLogsFilterClient added in v0.6.1

type CloudWatchLogsFilterClient interface {
	FilterLogEvents(ctx context.Context,
		params *cloudwatchlogs.FilterLogEventsInput,
		optFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.FilterLogEventsOutput, error)
}

CloudWatchLogsFilterClient interface for testing.

Jump to

Keyboard shortcuts

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