db

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskResultStatusClosed  = "closed"
	TaskResultStatusError   = "error"
	TaskResultStatusMerged  = "merged"
	TaskResultStatusOpen    = "open"
	TaskResultStatusPushed  = "pushed"
	TaskResultStatusUnknown = "unknown"
)

Variables

This section is empty.

Functions

func Migrations

func Migrations() fs.FS

Migrations returns all migrations bundled in a filesystem object.

Types

type Run

type Run struct {
	Error           *string
	ID              uint `gorm:"primarykey"`
	FinishedAt      *time.Time
	Reason          RunReason
	RepositoryNames StringList `gorm:"type:text"`
	ScheduleAfter   time.Time
	StartedAt       *time.Time
	Status          RunStatus
	TaskName        string
	RunData         StringMap `gorm:"type:text"`
}

type RunReason

type RunReason uint
const (
	RunReasonManual RunReason = iota
	RunReasonChanged
	RunReasonNew
	RunReasonNext
	RunReasonWebhook
	RunReasonCron
)

type RunStatus

type RunStatus uint
const (
	RunStatusPending RunStatus = iota
	RunStatusRunning
	RunStatusFinished
	RunStatusFailed
	RunStatusTimeout
)

type StringList

type StringList []string

StringList represents a database type that stores a list of strings.

func (*StringList) Scan

func (sl *StringList) Scan(value any) error

Scan implements [sql.Scanner].

func (StringList) Value

func (sl StringList) Value() (driver.Value, error)

Value implements [sql.Valuer].

type StringMap

type StringMap map[string]string

StringMap represents a field that contains multiple key/value pairs.

func (*StringMap) Scan

func (sm *StringMap) Scan(value any) error

Scan implements [sql.Scanner].

func (StringMap) String

func (sl StringMap) String() string

String serializes the content of the map to a string.

func (StringMap) Value

func (sl StringMap) Value() (driver.Value, error)

Value implements [sql.Valuer].

type Task

type Task struct {
	Active bool
	ID     uint `gorm:"primarykey"`
	Name   string
	Hash   string
}

type TaskResult

type TaskResult struct {
	CreatedAt      time.Time
	Error          *string
	ID             uint `gorm:"primarykey"`
	PullRequestUrl *string
	RepositoryName string
	Result         int
	Status         TaskResultStatus
	RunID          uint
}

type TaskResultStatus

type TaskResultStatus string

Jump to

Keyboard shortcuts

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