verifier

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveProfile

func SaveProfile(profile *Profile, path string) error

Types

type Config

type Config struct {
	Mode        Mode
	ConfigFile  string
	ProfileName string
	OutputMode  types.OutputMode
	DryRun      bool
	WarningsOk  bool
	RateLimit   int
	NoCleanup   bool
	ReportHTML  string
	ReportJSON  string
}

func DefaultConfig

func DefaultConfig() *Config

type ConsoleReporter

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

func NewConsoleReporter

func NewConsoleReporter(mode types.OutputMode) *ConsoleReporter

func (*ConsoleReporter) Print

func (r *ConsoleReporter) Print(result *types.CheckResult)

func (*ConsoleReporter) PrintFinal

func (r *ConsoleReporter) PrintFinal(report *Report)

type HTMLReporter

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

func NewHTMLReporter

func NewHTMLReporter(filePath string) *HTMLReporter

func (*HTMLReporter) Print

func (r *HTMLReporter) Print(result *types.CheckResult)

func (*HTMLReporter) PrintFinal

func (r *HTMLReporter) PrintFinal(report *Report)

type JSONReporter

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

func NewJSONReporter

func NewJSONReporter(filePath string) *JSONReporter

func (*JSONReporter) Print

func (r *JSONReporter) Print(result *types.CheckResult)

func (*JSONReporter) PrintFinal

func (r *JSONReporter) PrintFinal(report *Report)

func (*JSONReporter) PrintToWriter

func (r *JSONReporter) PrintToWriter(w io.Writer, report *Report) error

type Mode

type Mode string
const (
	ModeLocal  Mode = "local"
	ModeRemote Mode = "remote"
)

type Profile

type Profile struct {
	Name        string         `yaml:"name"`
	SMTPHost    string         `yaml:"smtp_host"`
	SMTPPort    int            `yaml:"smtp_port"`
	IMAPHost    string         `yaml:"imap_host"`
	IMAPPort    int            `yaml:"imap_port"`
	Domains     []string       `yaml:"domains"`
	TestUser    string         `yaml:"test_user"`
	PasswordEnv string         `yaml:"password_env"`
	Options     ProfileOptions `yaml:"options"`
}

func LoadProfile

func LoadProfile(name string) (*Profile, error)

type ProfileOptions

type ProfileOptions struct {
	TLS      bool          `yaml:"tls"`
	StartTLS bool          `yaml:"starttls"`
	Timeout  time.Duration `yaml:"timeout"`
}

type Report

type Report struct {
	Timestamp   time.Time            `json:"timestamp"`
	Server      string               `json:"server"`
	ConfigFile  string               `json:"config_file"`
	ProfileName string               `json:"profile_name"`
	Duration    time.Duration        `json:"duration_ms"`
	Summary     Summary              `json:"summary"`
	Checks      []*types.CheckResult `json:"checks"`
	ExitCode    int                  `json:"exit_code"`
}

func NewReport

func NewReport(server string, configFile string, profileName string) *Report

func (*Report) AddResult

func (rep *Report) AddResult(result *types.CheckResult)

func (*Report) ComputeExitCode

func (rep *Report) ComputeExitCode(warningsOk bool) int

func (*Report) DurationString

func (rep *Report) DurationString() string

func (*Report) GetStatus

func (rep *Report) GetStatus() string

func (*Report) GetStatusEmoji

func (rep *Report) GetStatusEmoji() string

func (*Report) SummaryString

func (rep *Report) SummaryString() string

type Reporter

type Reporter interface {
	Print(result *types.CheckResult)
	PrintFinal(report *Report)
}

type Summary

type Summary struct {
	Total    int `json:"total"`
	Passed   int `json:"passed"`
	Warnings int `json:"warnings"`
	Failed   int `json:"failed"`
}

type Verifier

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

func NewVerifier

func NewVerifier(cfg *Config, serverConfig *types.ServerConfig) *Verifier

func (*Verifier) GetReport

func (v *Verifier) GetReport() *Report

func (*Verifier) InitializeChecks

func (v *Verifier) InitializeChecks()

func (*Verifier) PrintFinalSummary

func (v *Verifier) PrintFinalSummary()

func (*Verifier) Run

func (v *Verifier) Run(ctx context.Context) (*Report, error)

Jump to

Keyboard shortcuts

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