Openstatus
www.openstatus.dev
1package database
2
3import "database/sql"
4
5// JobType represents the type of job for a monitor.
6type JobType string
7
8const (
9 JobTypeTCP JobType = "tcp"
10 JobTypeUDP JobType = "udp"
11 JobTypeHTTP JobType = "http"
12 JobTypeDNS JobType = "dns"
13)
14
15type Monitor struct {
16 ID int `db:"id"`
17 Active bool `db:"active"`
18 WorkspaceID int `db:"workspace_id"`
19 JobType JobType `db:"job_type"`
20 Periodicity string `db:"periodicity"`
21 URL string `db:"url"`
22 Headers string `db:"headers"`
23 Body string `db:"body"`
24 Method string `db:"method"`
25 Timeout int64 `db:"timeout"`
26 DegradedAfter sql.NullInt64 `db:"degraded_after"`
27 Assertions sql.NullString `db:"assertions"`
28 Retry int `db:"retry"`
29 FollowRedirects bool `db:"follow_redirects"`
30 OtelEndpoint sql.NullString `db:"otel_endpoint" json:"-"`
31 OtelHeaders sql.NullString `db:"otel_headers" json:"-"`
32 Name string `db:"name" json:"-"`
33 ExternalName sql.NullString `db:"external_name" json:"-"`
34 Description string `db:"description" json:"-"`
35 CreatedAt int `db:"created_at" json:"-"`
36 UpdatedAt int `db:"updated_at" json:"-"`
37 DeletedAt sql.NullInt64 `db:"deleted_at" json:"-"`
38 Regions string `db:"regions" json:"-"`
39 Status string `db:"status" json:"-"`
40 Public bool `db:"public" json:"-"`
41}
42
43type PrivateLocation struct {
44 ID int `db:"id"`
45}