storage

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResultStats added in v1.2.0

type AuthResultStats struct {
	Result string `json:"result"`
	Count  int    `json:"count"`
}

AuthResultStats holds authentication result statistics

type DispositionStats added in v1.2.0

type DispositionStats struct {
	Disposition string `json:"disposition"`
	Count       int    `json:"count"`
}

DispositionStats holds statistics for a disposition type

type DomainStats added in v1.2.0

type DomainStats struct {
	Domain            string  `json:"domain"`
	TotalMessages     int     `json:"total_messages"`
	CompliantMessages int     `json:"compliant_messages"`
	ComplianceRate    float64 `json:"compliance_rate"`
}

DomainStats holds statistics for a single domain

type OrgStats added in v1.2.0

type OrgStats struct {
	OrgName string `json:"org_name"`
	Reports int    `json:"reports"`
}

OrgStats holds statistics for a reporting organization

type ReportSummary

type ReportSummary struct {
	ID                int64   `json:"id"`
	ReportID          string  `json:"report_id"`
	OrgName           string  `json:"org_name"`
	Domain            string  `json:"domain"`
	DateBegin         int64   `json:"date_begin"`
	DateEnd           int64   `json:"date_end"`
	TotalMessages     int     `json:"total_messages"`
	CompliantMessages int     `json:"compliant_messages"`
	ComplianceRate    float64 `json:"compliance_rate"`
	PolicyP           string  `json:"policy_p"`
}

type Statistics

type Statistics struct {
	TotalReports      int     `json:"total_reports"`
	TotalMessages     int     `json:"total_messages"`
	CompliantMessages int     `json:"compliant_messages"`
	ComplianceRate    float64 `json:"compliance_rate"`
	UniqueSourceIPs   int     `json:"unique_source_ips"`
	UniqueDomains     int     `json:"unique_domains"`
}

type Storage

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

func NewStorage

func NewStorage(dbPath string) (*Storage, error)

NewStorage creates a new storage instance

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) GetDKIMStats added in v1.2.0

func (s *Storage) GetDKIMStats() ([]AuthResultStats, error)

GetDKIMStats returns DKIM authentication result statistics

func (*Storage) GetDispositionStats added in v1.2.0

func (s *Storage) GetDispositionStats() ([]DispositionStats, error)

GetDispositionStats returns message counts grouped by disposition

func (*Storage) GetDomainStats added in v1.2.0

func (s *Storage) GetDomainStats() ([]DomainStats, error)

GetDomainStats returns statistics grouped by domain

func (*Storage) GetOrgStats added in v1.2.0

func (s *Storage) GetOrgStats() ([]OrgStats, error)

GetOrgStats returns statistics grouped by reporting organization

func (*Storage) GetReportByID

func (s *Storage) GetReportByID(id int64) (*parser.Feedback, error)

func (*Storage) GetReports

func (s *Storage) GetReports(limit, offset int) ([]ReportSummary, error)

func (*Storage) GetSPFStats added in v1.2.0

func (s *Storage) GetSPFStats() ([]AuthResultStats, error)

GetSPFStats returns SPF authentication result statistics

func (*Storage) GetStatistics

func (s *Storage) GetStatistics() (*Statistics, error)

func (*Storage) GetTopSourceIPs

func (s *Storage) GetTopSourceIPs(limit int) ([]TopSourceIP, error)

func (*Storage) SaveReport

func (s *Storage) SaveReport(feedback *parser.Feedback) error

type TopSourceIP

type TopSourceIP struct {
	SourceIP string `json:"source_ip"`
	Count    int    `json:"count"`
	Pass     int    `json:"pass"`
	Fail     int    `json:"fail"`
}

Jump to

Keyboard shortcuts

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