web

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSData

type DNSData struct {
	Resolver string   `json:"resolver"`
	LastMs   *float64 `json:"last_ms"`
	AvgMs    float64  `json:"avg_ms"`
	Success  bool     `json:"success"`
}

type DashboardData

type DashboardData struct {
	Status    string       `json:"status"`
	Targets   []TargetData `json:"targets"`
	DNS       *DNSData     `json:"dns"`
	HTTP      *HTTPData    `json:"http"`
	Outages   []OutageData `json:"outages"`
	UpdatedAt int64        `json:"updated_at"`
}

func FetchDashboardData

func FetchDashboardData(s *store.Store, targets []string) DashboardData

type HTTPData

type HTTPData struct {
	Target     string   `json:"target"`
	LastMs     *float64 `json:"last_ms"`
	TLSMs      *float64 `json:"tls_ms"`
	StatusCode *int     `json:"status_code"`
	Success    bool     `json:"success"`
}

type OutageData

type OutageData struct {
	StartedAt string `json:"started_at"`
	Duration  string `json:"duration"`
	Cause     string `json:"cause"`
}

type Server

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

func NewServer

func NewServer(s *store.Store, targets []string, version, listen string) *Server

func (*Server) Start

func (srv *Server) Start() error

type TargetData

type TargetData struct {
	Target      string    `json:"target"`
	LastRTT     *float64  `json:"last_rtt"`
	AvgRTT      float64   `json:"avg_rtt"`
	LossPercent float64   `json:"loss_pct"`
	Jitter      *float64  `json:"jitter"`
	Sparkline   []float64 `json:"sparkline"`
}

Jump to

Keyboard shortcuts

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