db

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(enableLog, migrate bool, path string) (*gorm.DB, error)

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
}

type RunReason

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

type RunStatus

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

type StringList added in v0.16.0

type StringList []string

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

func (*StringList) Scan added in v0.16.0

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

Scan implements [sql.Scanner].

func (StringList) Value added in v0.16.0

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

Scan implements [sql.Valuer].

type Task

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

type TaskResult

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

Jump to

Keyboard shortcuts

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