stat

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	LatestDateWithData(ctx context.Context) (string, error)

	// Spamclickrate endpoints
	GlobalSpamclickRate(ctx context.Context, date string) (*SpamclickRate, error)
	SpamclickRateByDKIMDomains(ctx context.Context, date string) (map[string]*SpamclickRate, error)
	SpamclickRateByIPs(ctx context.Context, date string) (map[string]*SpamclickRate, error)
	SpamclickRateComplianceStatusByIP(ctx context.Context, date, ip string) (string, error)

	// Spamtrap endpoints
	GlobalSpamtrapHits(ctx context.Context, date string) (int, error)
	SpamtrapHitsByDKIMDomains(ctx context.Context, date string) (map[string]int, error)
	SpamtrapHitsByIPs(ctx context.Context, date string) (map[string]int, error)

	// DKIM errors endpoints
	GlobalDKIMErrors(ctx context.Context, date string) (*DKIMError, error)
	DKIMErrorsByDKIMDomains(ctx context.Context, date string) (map[string]*DKIMError, error)
	DKIMErrorsByIPs(ctx context.Context, date string) (map[string]*DKIMError, error)

	// ip report endpoint
	IPReport(ctx context.Context, date string) (map[string]*IPReport, error)
}

Client represents the functions implemented by this API

func New

func New(transport *transport.Client) Client

New creates a new Client for the task Endpoint

type DKIMError added in v1.2.0

type DKIMError struct {
	Errors      int `json:"errors"`
	TotalVolume int `json:"total_volume"`
}

DKIMError infos about global dkim errors returned by /stat/dkimerrors

type IPHostnameMap

type IPHostnameMap map[string]string

IPHostnameMap map of ip to hostname

type IPReport

type IPReport struct {
	ComplaintAddress string      `json:"complaint_address"`
	FBLAddress       string      `json:"fbl_address"`
	IPs              IPStatusMap `json:"ips"`
}

IPReport information returned by /stat/ipreport

type IPStatusMap

type IPStatusMap map[string]IPHostnameMap

IPStatusMap map between status and a list of ip-hostnames

type Scope

type Scope string

Scope used for selecting stats

const (
	// ScopeGlobal information aggregated
	ScopeGlobal Scope = "global"
	// ScopeDKIMDomains information summed by dkim domain
	ScopeDKIMDomains Scope = "dkimdomain"
	// ScopeIP information summed by IP
	ScopeIP Scope = "ip"
)

type SpamclickRate

type SpamclickRate struct {
	Min float64 `json:"min"`
	Avg float64 `json:"avg"`
	Max float64 `json:"max"`
}

SpamclickRate returned by /stat/spamclickrate

Jump to

Keyboard shortcuts

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