models

package
v0.0.0-...-d263f1c Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pending     JobStatus = "Pending"
	Running     JobStatus = "Running"
	Finished    JobStatus = "Finished"
	Failed      JobStatus = "Failed"
	CREATE_ENUM string    = `` /* 183-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

Types

type Job

type Job struct {
	ID        uint           `json:"id"`
	Status    JobStatus      `json:"status" gorm:"type:job_status"`
	Name      string         `json:"name" binding:"required"`
	Args      datatypes.JSON `json:"args" binding:"required"`
	Result    datatypes.JSON `json:"result"`
	UserID    uint           `json:"userID" binding:"required"`
	User      *User          `json:"user"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`

} //@name Job

type JobStatus

type JobStatus string

func (*JobStatus) Scan

func (s *JobStatus) Scan(value interface{}) error

func (JobStatus) Value

func (s JobStatus) Value() (driver.Value, error)

type User

type User struct {
	ID             uint      `json:"id"`
	Name           string    `json:"name"`
	Email          string    `gorm:"uniqueIndex" json:"email"`
	HashedPassword string    `json:"-"`
	IsActive       bool      `json:"isActive"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`

} //@name User

Jump to

Keyboard shortcuts

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