store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSResult

type DNSResult struct {
	ID          int64
	Timestamp   int64
	Query       string
	Resolver    string
	ResolveMs   *float64
	Success     bool
	ResolvedIPs string
}

type HTTPResult

type HTTPResult struct {
	ID         int64
	Timestamp  int64
	Target     string
	TotalMs    *float64
	TLSMs      *float64
	StatusCode *int
	Success    bool
}

type Outage

type Outage struct {
	ID         int64
	StartedAt  int64
	EndedAt    *int64
	DurationMs *int64
	Cause      string
}

type PingResult

type PingResult struct {
	ID         int64
	Timestamp  int64
	Target     string
	RTTMs      *float64
	PacketLoss bool
	JitterMs   *float64
	ProbeType  string
}

type Store

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

func New

func New(dbPath string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CloseOutage

func (s *Store) CloseOutage(id int64, endedAt int64) error

func (*Store) DNSStats

func (s *Store) DNSStats(since int64) (avg float64, count int, err error)

func (*Store) DeleteOlderThan

func (s *Store) DeleteOlderThan(before time.Time) error

func (*Store) InsertDNS

func (s *Store) InsertDNS(result DNSResult) error

func (*Store) InsertHTTP

func (s *Store) InsertHTTP(result HTTPResult) error

func (*Store) InsertOutage

func (s *Store) InsertOutage(outage Outage) (int64, error)

func (*Store) InsertPing

func (s *Store) InsertPing(result PingResult) error

func (*Store) LatestDNS

func (s *Store) LatestDNS() (*DNSResult, error)

func (*Store) LatestHTTP

func (s *Store) LatestHTTP() (*HTTPResult, error)

func (*Store) LatestPing

func (s *Store) LatestPing(target string) (*PingResult, error)

func (*Store) OpenOutage

func (s *Store) OpenOutage() (*Outage, error)

func (*Store) PingStats

func (s *Store) PingStats(target string, since int64) (avg float64, count int, lossCount int, err error)

func (*Store) QueryAllPings

func (s *Store) QueryAllPings(since, until int64) ([]PingResult, error)

func (*Store) QueryDNS

func (s *Store) QueryDNS(since, until int64) ([]DNSResult, error)

func (*Store) QueryHTTP

func (s *Store) QueryHTTP(since, until int64) ([]HTTPResult, error)

func (*Store) QueryOutages

func (s *Store) QueryOutages(since, until int64, limit int) ([]Outage, error)

func (*Store) QueryPings

func (s *Store) QueryPings(target string, since, until int64) ([]PingResult, error)

func (*Store) RecentOutages

func (s *Store) RecentOutages(limit int) ([]Outage, error)

func (*Store) StartRetentionCleanup

func (s *Store) StartRetentionCleanup(retention time.Duration, stop <-chan struct{})

Jump to

Keyboard shortcuts

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