ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / test (pull_request) Successful in 9m5s
ci / lint (pull_request) Successful in 10m24s
ci / build (pull_request) Successful in 18m10s
ci / image (pull_request) Successful in 5m16s
Visitors can subscribe to a page's incidents by email where the organization allows it. They confirm their address first; confirmation and unsubscribe links only show a button, so mail scanners do not act on them, and mails carry RFC 8058 one-click unsubscribe headers. Subscribers get a mail when an incident opens or resolves and for every public update. Every page also has an RSS feed of incidents and planned maintenance and a read-only JSON API (status, summary, components, incidents), both served from the cached snapshot. Abuse protection: status page servers limit feed and API reads, subscription requests and link actions per visitor; the API limits subscription requests per visitor, mailbox and page, and a new limit caps the subscriptions an organization's pages gain in seven days (platform default and per-organization override, 1000 in the cloud). Unconfirmed subscriptions count towards it and are deleted after a week. The fixed cap of 200 monitors per status page is gone; the configurable limit alone decides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
540 lines
10 KiB
Go
540 lines
10 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package store
|
|
|
|
import (
|
|
"net/netip"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Agent struct {
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Kind string
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
LastSeenAt *time.Time
|
|
Release *string
|
|
CreatedAt time.Time
|
|
RegionID *uuid.UUID
|
|
AllowPrivate bool
|
|
}
|
|
|
|
type AgentInstance struct {
|
|
ID uuid.UUID
|
|
AgentID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Release string
|
|
StartedAt time.Time
|
|
LastSeenAt time.Time
|
|
}
|
|
|
|
type AgentStorage struct {
|
|
Owner string
|
|
Key string
|
|
Value []byte
|
|
Modified time.Time
|
|
}
|
|
|
|
type AlertGroup struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
IsDefault bool
|
|
QuietHours []byte
|
|
}
|
|
|
|
type AlertGroupChannel struct {
|
|
OrgID uuid.UUID
|
|
GroupID uuid.UUID
|
|
ChannelID uuid.UUID
|
|
}
|
|
|
|
type AlertmanagerAlert struct {
|
|
OrgID uuid.UUID
|
|
Fingerprint string
|
|
ReceiverID uuid.UUID
|
|
Status string
|
|
Labels []byte
|
|
Annotations []byte
|
|
StartsAt time.Time
|
|
GeneratorUrl string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type AlertmanagerReceiver struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
CreatedAt time.Time
|
|
LastReceivedAt *time.Time
|
|
}
|
|
|
|
type ApiToken struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
Permissions []string
|
|
ExpiresAt *time.Time
|
|
LastUsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type AuditEvent struct {
|
|
ID uuid.UUID
|
|
Time time.Time
|
|
Kind string
|
|
OrgID *uuid.UUID
|
|
ActorUserID *uuid.UUID
|
|
ActorTokenID *uuid.UUID
|
|
Action string
|
|
TargetID *uuid.UUID
|
|
Details []byte
|
|
Status int32
|
|
Ip *netip.Addr
|
|
UserAgent *string
|
|
RequestID *string
|
|
}
|
|
|
|
type CheckEvidence struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
CheckerID uuid.UUID
|
|
Time time.Time
|
|
Ok bool
|
|
StatusCode *int32
|
|
Error *string
|
|
Evidence []byte
|
|
}
|
|
|
|
type CheckResult struct {
|
|
Time time.Time
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
CheckerID uuid.UUID
|
|
Ok bool
|
|
LatencyMs *int32
|
|
StatusCode *int32
|
|
Error *string
|
|
}
|
|
|
|
type CheckResults1d struct {
|
|
Bucket interface{}
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
Total int64
|
|
OkCount int64
|
|
AvgLatencyMs float32
|
|
MaxLatencyMs interface{}
|
|
}
|
|
|
|
type CheckResults1h struct {
|
|
Bucket interface{}
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
Total int64
|
|
OkCount int64
|
|
AvgLatencyMs float32
|
|
MaxLatencyMs interface{}
|
|
}
|
|
|
|
type Incident struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
StartedAt time.Time
|
|
ResolvedAt *time.Time
|
|
Cause []byte
|
|
Title string
|
|
Status *string
|
|
StatusID *uuid.UUID
|
|
}
|
|
|
|
type IncidentStatus struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Color string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type IncidentUpdate struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
IncidentID uuid.UUID
|
|
Status string
|
|
Message string
|
|
Public bool
|
|
AuthorID *uuid.UUID
|
|
CreatedAt time.Time
|
|
StatusID *uuid.UUID
|
|
}
|
|
|
|
type Invitation struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Email string
|
|
RoleID uuid.UUID
|
|
TokenHash []byte
|
|
InvitedBy *uuid.UUID
|
|
ExpiresAt time.Time
|
|
AcceptedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type LatestResult struct {
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
OrgID uuid.UUID
|
|
Time time.Time
|
|
Ok bool
|
|
LatencyMs *int32
|
|
StatusCode *int32
|
|
Error *string
|
|
}
|
|
|
|
type LegalAcceptance struct {
|
|
UserID uuid.UUID
|
|
Kind string
|
|
Version int64
|
|
AcceptedAt time.Time
|
|
}
|
|
|
|
type LegalDocument struct {
|
|
OrgID *uuid.UUID
|
|
Kind string
|
|
Url string
|
|
Markdown string
|
|
UpdatedAt time.Time
|
|
Version int64
|
|
}
|
|
|
|
type MaintenanceTarget struct {
|
|
WindowID uuid.UUID
|
|
OrgID uuid.UUID
|
|
MonitorID *uuid.UUID
|
|
GroupID *uuid.UUID
|
|
}
|
|
|
|
type MaintenanceWindow struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Title string
|
|
Description string
|
|
StartsAt time.Time
|
|
DurationSeconds int32
|
|
TimeZone string
|
|
Recurrence string
|
|
Every int32
|
|
Weekdays []int16
|
|
Until *time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Membership struct {
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
IsOwner bool
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Monitor struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Type string
|
|
Target string
|
|
IntervalSeconds int32
|
|
TimeoutMs int32
|
|
Config []byte
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
Confirmations int32
|
|
GroupID *uuid.UUID
|
|
Position *int32
|
|
}
|
|
|
|
type MonitorAlertGroup struct {
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
GroupID uuid.UUID
|
|
}
|
|
|
|
type MonitorGroup struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
ParentID *uuid.UUID
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type MonitorRegion struct {
|
|
MonitorID uuid.UUID
|
|
OrgID uuid.UUID
|
|
RegionID uuid.UUID
|
|
}
|
|
|
|
type Notification struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
ChannelID uuid.UUID
|
|
IncidentID uuid.UUID
|
|
Event string
|
|
Status string
|
|
Attempts int32
|
|
NextAttemptAt time.Time
|
|
LastError *string
|
|
CreatedAt time.Time
|
|
SentAt *time.Time
|
|
}
|
|
|
|
type NotificationChannel struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Type string
|
|
Config []byte
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Org struct {
|
|
ID uuid.UUID
|
|
Slug string
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
RequireTotp bool
|
|
RequireSso bool
|
|
ApiTokenMaxDays *int32
|
|
DisabledCheckTypes []string
|
|
SuspendedAt *time.Time
|
|
SuspendedReason string
|
|
LimitMonitors *int32
|
|
LimitStatusPages *int32
|
|
LimitRegionsPerMonitor *int32
|
|
LimitOwnRegionsCount *bool
|
|
LimitMonitorsPerPage *int32
|
|
LimitSubscribersPerWeek *int32
|
|
}
|
|
|
|
type PlatformIdentity struct {
|
|
ProviderID uuid.UUID
|
|
Subject string
|
|
UserID uuid.UUID
|
|
Email *string
|
|
CreatedAt time.Time
|
|
LastLoginAt time.Time
|
|
}
|
|
|
|
type PlatformIdentityProvider struct {
|
|
ID uuid.UUID
|
|
Kind string
|
|
Name string
|
|
Issuer string
|
|
ClientID string
|
|
ClientSecret []byte
|
|
AllowSignup bool
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type PlatformSetting struct {
|
|
Key string
|
|
Value []byte
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RecoveryCode struct {
|
|
UserID uuid.UUID
|
|
CodeHash []byte
|
|
UsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Region struct {
|
|
Key string
|
|
Name string
|
|
CreatedAt time.Time
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
}
|
|
|
|
type Role struct {
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Key *string
|
|
Name string
|
|
Permissions []string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RoleAssignment struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
RoleID uuid.UUID
|
|
ResourceType *string
|
|
ResourceID *uuid.UUID
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type SsoProvider struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Issuer string
|
|
ClientID string
|
|
ClientSecret []byte
|
|
Scopes []string
|
|
AllowedDomains []string
|
|
AutoProvision bool
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
DefaultRoleID *uuid.UUID
|
|
}
|
|
|
|
type StatusPage struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Slug string
|
|
Title string
|
|
Description string
|
|
Published bool
|
|
CustomDomain *string
|
|
DomainToken string
|
|
DomainVerifiedAt *time.Time
|
|
Theme []byte
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
ShowComponentDetails bool
|
|
SuspendedAt *time.Time
|
|
SuspendedReason string
|
|
DomainSetAt *time.Time
|
|
DomainCheckedAt *time.Time
|
|
DomainFailingSince *time.Time
|
|
DomainVerifyMethod *string
|
|
Subscriptions bool
|
|
}
|
|
|
|
type StatusPageGroup struct {
|
|
ID uuid.UUID
|
|
PageID uuid.UUID
|
|
OrgID uuid.UUID
|
|
ParentID *uuid.UUID
|
|
Name string
|
|
Position int32
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type StatusPageMonitor struct {
|
|
PageID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Section string
|
|
Label string
|
|
Position int32
|
|
GroupID *uuid.UUID
|
|
}
|
|
|
|
type StatusPageSubscriber struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
PageID uuid.UUID
|
|
Email string
|
|
Locale string
|
|
PageUrl string
|
|
CreatedAt time.Time
|
|
ConfirmedAt *time.Time
|
|
}
|
|
|
|
type SubscriberNotification struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
SubscriberID uuid.UUID
|
|
IncidentID uuid.UUID
|
|
UpdateID *uuid.UUID
|
|
Event string
|
|
Status string
|
|
Attempts int32
|
|
NextAttemptAt time.Time
|
|
LastError *string
|
|
CreatedAt time.Time
|
|
SentAt *time.Time
|
|
}
|
|
|
|
type SupportMessage struct {
|
|
ID uuid.UUID
|
|
TicketID uuid.UUID
|
|
AuthorID *uuid.UUID
|
|
FromStaff bool
|
|
Body string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type SupportTicket struct {
|
|
ID uuid.UUID
|
|
UserID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
MonitorID *uuid.UUID
|
|
ChannelID *uuid.UUID
|
|
AlertGroupID *uuid.UUID
|
|
StatusPageID *uuid.UUID
|
|
IncidentID *uuid.UUID
|
|
Subject string
|
|
Status string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type User struct {
|
|
ID uuid.UUID
|
|
Email string
|
|
DisplayName string
|
|
PasswordHash *string
|
|
DisabledAt *time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
TotpSecret []byte
|
|
TotpEnabledAt *time.Time
|
|
Locale *string
|
|
IsAdmin bool
|
|
DisabledReason string
|
|
LimitOrgs *int32
|
|
EmailVerifiedAt *time.Time
|
|
EmailKey *string
|
|
}
|
|
|
|
type UserIdentity struct {
|
|
ProviderID uuid.UUID
|
|
Subject string
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Email *string
|
|
CreatedAt time.Time
|
|
LastLoginAt time.Time
|
|
}
|