modelresponse

package
v0.0.0-...-1b34132 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Template         string
	Name             string    `json:"name"`
	IsUp             bool      `json:"isUp"`
	ResponseTimeInMS int64     `json:"responseTime"`
	Scheme           string    `json:"scheme"`
	IPResolves       []string  `json:"ipResolves"`
	SSL              CheckSSL  `json:"ssl"`
	ICMP             CheckICMP `json:"icmp"`
}

func (Check) ToMarkdown

func (m Check) ToMarkdown(ctx *appcontext.AppContext) string

type CheckICMP

type CheckICMP struct {
	PackageTransmitted int     `json:"packageTransmitted"`
	PackageReceived    int     `json:"packageReceived"`
	PackageLoss        float64 `json:"packageLoss"`
}

type CheckSSL

type CheckSSL struct {
	ExpireAt *TimeResponse `json:"expireAt"`
	Issuer   string        `json:"issuer"`
}

type HealthCheckRecordResponseTimeChartData

type HealthCheckRecordResponseTimeChartData struct {
	Date string  `json:"date"`
	Hour int     `json:"hour"`
	Avg  float64 `json:"avg"`
}

type HealthCheckRecordResponseTimeMetrics

type HealthCheckRecordResponseTimeMetrics struct {
	Average          float64 `json:"average"`
	Max              float64 `json:"max"`
	Min              float64 `json:"min"`
	UptimePercentage float64 `json:"uptimePercentage"`
}

type Monitor

type Monitor struct {
	Code      string        `json:"code"`
	Type      string        `json:"type"`
	Target    string        `json:"target"`
	Interval  int           `json:"interval"`
	CreatedAt *TimeResponse `json:"createdAt"`
}

type Stats

type Stats struct {
	Monitor        Monitor                                  `json:"monitor"`
	ResponseTime   *HealthCheckRecordResponseTimeMetrics    `json:"responseTime"`
	Chart          []HealthCheckRecordResponseTimeChartData `json:"chart"`
	ChartImageName string                                   `json:"-"`
}

func (Stats) ToMarkdown

func (m Stats) ToMarkdown(ctx *appcontext.AppContext) string

type TimeResponse

type TimeResponse struct {
	Time time.Time
}

func NewTimeResponse

func NewTimeResponse(t time.Time) *TimeResponse

func (*TimeResponse) FormatISODate

func (t *TimeResponse) FormatISODate() string

func (*TimeResponse) FormatYYYYMMDD

func (t *TimeResponse) FormatYYYYMMDD() string

func (*TimeResponse) MarshalJSON

func (t *TimeResponse) MarshalJSON() ([]byte, error)

func (*TimeResponse) UnmarshalJSON

func (t *TimeResponse) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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