models

package
v0.0.0-...-5b79b7b Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Draft      PlanStatusType = "DRAFT"
	Review                    = "REVIEW"
	Schedules                 = "SCHEDULED"
	InProgress                = "IN_PROGRESS"
	Aborted                   = "ABORTED"
	Completed                 = "COMPLETED"
)

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDatabase

func ConnectDatabase()

Types

type BaseModel

type BaseModel struct {
	ID        uuid.UUID `json:"id" gorm:"type:uuid;primary_key`
	CreatedAt time.Time `json:"createdAt"`
}

func (*BaseModel) BeforeCreate

func (model *BaseModel) BeforeCreate(scope *gorm.Scope) error

type Plan

type Plan struct {
	BaseModel
	Title        string         `json:"title"`
	Author       string         `json:"author"`
	StartTime    *time.Time     `json:"start"`
	EndTime      *time.Time     `json:"end"`
	Operator     string         `json:"operator"`
	Status       PlanStatusType `json:"status"`
	Overview     string         `json:"overview" gorm:"default:''"`
	RollbackPlan string         `json:"rollbackPlan" gorm:"default:''"`
	PlanComments []PlanComment  `json:"planComments"`
}

Plan model

type PlanComment

type PlanComment struct {
	BaseModel
	Author string    `json:"author"`
	PlanID uuid.UUID `json:"planId"`
	Body   string    `json:"body"`
}

PlanComment model

type PlanStatusType

type PlanStatusType string

Jump to

Keyboard shortcuts

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