storage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 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 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) GetReportByID

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

func (*Storage) GetReports

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

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