model_db

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialect schema.Dialect

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	bun.BaseModel `bun:"table:apikeys"`

	ID          BinaryUUID `bun:"id,notnull"`
	Description *string    `bun:"description"`
	SecretSalt  []byte     `bun:"secret_salt,notnull"`
	SecretHash  []byte     `bun:"secret_hash,notnull"`
	CreatedAt   time.Time  `bun:"created_at,nullzero,notnull"`
	UpdatedAt   time.Time  `bun:"updated_at,nullzero,notnull"`
	UserID      BinaryUUID `bun:"user_id,notnull"`
}

type BinaryUUID

type BinaryUUID uuid.UUID

func (*BinaryUUID) Scan

func (u *BinaryUUID) Scan(value any) error

func (BinaryUUID) String

func (u BinaryUUID) String() string

func (BinaryUUID) UUID

func (u BinaryUUID) UUID() uuid.UUID

func (BinaryUUID) Value

func (u BinaryUUID) Value() (driver.Value, error)

type Label

type Label struct {
	bun.BaseModel `bun:"table:labels"`

	ID        int64      `bun:"id,notnull,autoincrement"`
	SessionID BinaryUUID `bun:"session_id,notnull"`
	Key       string     `bun:"key,notnull"`
	Value     *string    `bun:"value"`
	UserID    BinaryUUID `bun:"user_id,notnull"`
	CreatedAt time.Time  `bun:"created_at,nullzero,notnull"`
	UpdatedAt time.Time  `bun:"updated_at,nullzero,notnull"`
}

type Session

type Session struct {
	bun.BaseModel `bun:"table:sessions"`

	ID          BinaryUUID      `bun:"id,notnull"`
	Description *string         `bun:"description"`
	Baggage     json.RawMessage `bun:"baggage"`
	CreatedAt   time.Time       `bun:"created_at,nullzero,notnull"`
	UpdatedAt   time.Time       `bun:"updated_at,nullzero,notnull"`
	UserID      BinaryUUID      `bun:"user_id,notnull"`
}

type Testcase

type Testcase struct {
	bun.BaseModel `bun:"table:testcases"`

	ID        BinaryUUID      `bun:"id,notnull"`
	SessionID BinaryUUID      `bun:"session_id,notnull"`
	Name      string          `bun:"name,notnull"`
	Classname *string         `bun:"classname"`
	File      *string         `bun:"file"`
	Testsuite *string         `bun:"testsuite"`
	Output    *string         `bun:"output"`
	Status    TestcaseStatus  `bun:"status,notnull"`
	Baggage   json.RawMessage `bun:"baggage"`
	CreatedAt time.Time       `bun:"created_at,nullzero,notnull"`
	UpdatedAt time.Time       `bun:"updated_at,nullzero,notnull"`
	UserID    BinaryUUID      `bun:"user_id,notnull"`
}

type TestcaseStatus

type TestcaseStatus int
const (
	StatusError TestcaseStatus = iota
	StatusFail
	StatusPass
	StatusSkip
)

type User

type User struct {
	bun.BaseModel `bun:"table:users"`

	ID           BinaryUUID `bun:"id,notnull"`
	Username     string     `bun:"username,notnull"`
	PasswordSalt []byte     `bun:"password_salt,notnull"`
	PasswordHash []byte     `bun:"password_hash,notnull"`
	Role         UserRole   `bun:"role,notnull"`
	CreatedAt    time.Time  `bun:"created_at,nullzero,notnull"`
	UpdatedAt    time.Time  `bun:"updated_at,nullzero,notnull"`
}

type UserRole added in v0.20.0

type UserRole string
const (
	RoleEditor UserRole = "editor"
	RoleViewer UserRole = "viewer"
)

Jump to

Keyboard shortcuts

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