db

package
v0.0.0-...-da65128 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CreateJob

func CreateJob(job *Job) error

func DeleteJob

func DeleteJob(creator string, uuid string)

func Init

func Init()

func UpdateJob

func UpdateJob(j *Job) error

Types

type Job

type Job struct {
	gorm.Model
	ID                uint64            `gorm:"id" json:"id""`
	UUID              string            `gorm:"uuid" json:"uuid"`
	Creator           string            `gorm:"creator" json:"creator"`
	JupyterFileName   string            `gorm:"jupyter_file_name" json:"jupyter_file_name"`
	BuildContextPath  string            `gorm:"build_context_path" json:"build_context_path"`
	Dockerfile        string            `gorm:"dockerfile" json:"dockerfile"`
	DockerImage       string            `gorm:"docker_image" json:"docker_image"`
	DockerImageDigest string            `gorm:"docker_image_digest" json:"docker_image_digest"`
	AttestationReport string            `gorm:"attestation_report" json:"attestation_report"`
	JobStatus         int               `gorm:"job_status" json:"job_status"`
	InstanceName      string            `gorm:"instance_name" json:"instance_name"`
	ExtraEnvs         map[string]string `gorm:"serializer:json"`
}

func GetAllInProgressJobs

func GetAllInProgressJobs() ([]*Job, error)

func GetInProgressJobs

func GetInProgressJobs(creator string) ([]*Job, error)

func QueryJobByIdAndCreator

func QueryJobByIdAndCreator(jobId int64, creator string) (*Job, error)

func QueryJobByUUIDAndCreator

func QueryJobByUUIDAndCreator(creator string, uuid string) (*Job, error)

func QueryJobsByCreator

func QueryJobsByCreator(creator string, page, pageSize int64) ([]*Job, int64, error)

func (Job) TableName

func (Job) TableName() string

Jump to

Keyboard shortcuts

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