database

package
v0.0.0-...-295e5a7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close closes the database connection.

func New

func New() *sqlx.DB

New returns a database connection, reusing an existing connection if available.

Types

type JobType

type JobType string

JobType represents the type of job for a monitor.

const (
	JobTypeTCP  JobType = "tcp"
	JobTypeUDP  JobType = "udp"
	JobTypeHTTP JobType = "http"
	JobTypeDNS  JobType = "dns"
)

type Monitor

type Monitor struct {
	ID              int            `db:"id"`
	Active          bool           `db:"active"`
	WorkspaceID     int            `db:"workspace_id"`
	JobType         JobType        `db:"job_type"`
	Periodicity     string         `db:"periodicity"`
	URL             string         `db:"url"`
	Headers         string         `db:"headers"`
	Body            string         `db:"body"`
	Method          string         `db:"method"`
	Timeout         int64          `db:"timeout"`
	DegradedAfter   sql.NullInt64  `db:"degraded_after"`
	Assertions      sql.NullString `db:"assertions"`
	Retry           int            `db:"retry"`
	FollowRedirects bool           `db:"follow_redirects"`
	OtelEndpoint    sql.NullString `db:"otel_endpoint" json:"-"`
	OtelHeaders     sql.NullString `db:"otel_headers" json:"-"`
	Name            string         `db:"name" json:"-"`
	ExternalName    sql.NullString `db:"external_name" json:"-"`
	Description     string         `db:"description" json:"-"`
	CreatedAt       int            `db:"created_at" json:"-"`
	UpdatedAt       int            `db:"updated_at" json:"-"`
	DeletedAt       sql.NullInt64  `db:"deleted_at" json:"-"`
	Regions         string         `db:"regions" json:"-"`
	Status          string         `db:"status" json:"-"`
	Public          bool           `db:"public" json:"-"`
}

type PrivateLocation

type PrivateLocation struct {
	ID   int    `db:"id"`
	Name string `db:"name"`
}

Jump to

Keyboard shortcuts

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