detective

package
v0.0.0-...-4be01c1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ResultsPerPage = 100

Variables

View Source
var CSVHeader = []string{
	"MailFrom",
	"MailTo",
	"MessageID",
	"Queue",
	"NumberOfAttempts",
	"TimeMin",
	"TimeMax",
	"Status",
	"DSN",
	"Expired",
	"Relays",
	"RawLogMsgs",
}
View Source
var ErrNoAvailableLogs = errors.New(`No available logs`)

Functions

This section is empty.

Types

type Detective

type Detective interface {
	CheckMessageDelivery(ctx context.Context, from, to string, interval timeutil.TimeInterval, status int, someID string, page int, limit int) (*MessagesPage, error)
	OldestAvailableTime(context.Context) (time.Time, error)
}

func New

func New(deliveriesConnPool *dbconn.RoPool, rawLogsAccessor rawlogsdb.Accessor) (Detective, error)

type Message

type Message struct {
	Queue     QueueName         `json:"queue"`
	MessageID string            `json:"message_id"`
	Entries   []MessageDelivery `json:"entries"`
}

type MessageDelivery

type MessageDelivery struct {
	NumberOfAttempts int        `json:"number_of_attempts"`
	TimeMin          time.Time  `json:"time_min"`
	TimeMax          time.Time  `json:"time_max"`
	Status           Status     `json:"status"`
	Dsn              string     `json:"dsn"`
	Relays           []string   `json:"relays"`
	Expired          *time.Time `json:"expired"`
	MailFrom         string     `json:"from"`
	MailTo           []string   `json:"to"`
	RawLogMsgs       []string   `json:"log_msgs"`
}

func (*MessageDelivery) ExportCSV

func (d *MessageDelivery) ExportCSV(queue, messageid string) []string

type Messages

type Messages = []Message

type MessagesPage

type MessagesPage struct {
	PageNumber   int      `json:"page"`
	FirstPage    int      `json:"first_page"`
	LastPage     int      `json:"last_page"`
	TotalResults int      `json:"total"`
	Messages     Messages `json:"messages"`
}

func (*MessagesPage) ExportCSV

func (p *MessagesPage) ExportCSV() [][]string

type QueueName

type QueueName = string

type Status

type Status parser.SmtpStatus

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(d []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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