model

package
v0.0.0-...-e0012a9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	StringLike `json:"StringLike"`
}

type Course

type Course struct {
	gorm.Model
	CourseName     string `json:"courseName" gorm:"unique;index;not null"`
	BaseLibvirtXML string `json:"baseLibvirtXML"`

	TeacherID       uint            `json:"-"`
	Teacher         User            `json:"teacher" gorm:"foreignKey:TeacherID"`
	StatusID        uint            `json:"-" `
	Status          Status          `json:"status" gorm:"foreignKey:StatusID"`
	MachineConfigID uint            `json:"-" `
	MachineConfig   MachineConfig   `json:"machineConfig" gorm:"foreignKey:MachineConfigID"`
	ImageID         uint            `json:"-" `
	Image           ImageOrSnapshot `json:"image" gorm:"unique;foreignKey:ImageID"`
}

type CreateCourseOpt

type CreateCourseOpt struct {
	CourseName   string `json:"courseName"`
	ImageName    string `json:"imageName"`
	Note         string `json:"note"`
	ConfigNumber uint   `json:"configs"`
	Creator      string
}

type CreateVMOpt

type CreateVMOpt struct {
	CourseName   string `json:"courseName"`
	InstanceName string `json:"instanceName"`
	Creator      string
}

type ImageOrSnapshot

type ImageOrSnapshot struct {
	gorm.Model
	Type         string `json:"type" gorm:"not null"`
	Location     string `json:"location" gorm:"not null;unique"`
	GenerateType int32  `json:"generateType" gorm:"not null"`
	Name         string `json:"name" gorm:"not null"`

	CreatorID uint `json:"-"`
	Creator   User `json:"creator" gorm:"foreignKey:CreatorID;not null"`
}

type MachineConfig

type MachineConfig struct {
	gorm.Model
	CPU int32 `json:"cpu" gorm:"not null"`
	RAM int32 `json:"ram" gorm:"not null"`
}

type Snapshot

type Snapshot struct {
	gorm.Model
	VMName           string
	SnapshotName     string
	SnapshotLocation string
}

type Statement

type Statement struct {
	Effect    string    `json:"Effect"`
	Action    []string  `json:"Action"`
	Resource  []string  `json:"Resource"`
	Condition Condition `json:"Condition,omitempty"`
}

type Status

type Status struct {
	gorm.Model
	Status string `json:"Status" gorm:"not null"`
}

type StringLike

type StringLike struct {
	S3Prefix []string `json:"s3:prefix"`
}

type User

type User struct {
	gorm.Model
	Uuid     string `json:"uuid" gorm:"type:varchar(150);not null;unique_index:idx_uuid;comment:'uuid'" example:"1234345"`
	Username string `json:"username" form:"username" binding:"required" gorm:"unique;not null; comment:'用户名'" example:"account name"`
	Password string `json:"password" form:"password" binding:"required" gorm:"type:varchar(150);not null; comment:'密码'" example:"password"`
	Nickname string `json:"nickname" gorm:"comment:'昵称'" example:"nickname"`
	Avatar   string `json:"avatar" gorm:"type:varchar(150);comment:'头像'" example:"bcdedit"`
	Email    string `json:"email" gorm:"type:varchar(80);column:email;comment:'邮箱'" example:"2123@qq.com"`

	UserTypeID uint     `json:"-"`
	UserType   UserType `json:"userType" gorm:"foreignKey:UserTypeID"`
}

type UserAccessConf

type UserAccessConf struct {
	Version   string      `json:"Version"`
	Statement []Statement `json:"Statement"`
}

type UserType

type UserType struct {
	gorm.Model
	Type string `json:"type" gorm:"comment:'type'"`
}

type VM

type VM struct {
	gorm.Model
	IP                string `json:"ip" gorm:"not null"`
	Port              string `json:"port" gorm:"not null"`
	LibvirtXML        string `json:"libvirtXML" gorm:"not null"`
	Name              string `json:"name" gorm:"unique;not null"`
	BaseImageFileName string `json:"imageFileLocation" gorm:"not null"`

	CreatorID      uint   `json:"-"`
	Creator        User   `json:"creator" gorm:"foreignKey:CreatorID"`
	SourceCourseID uint   `json:"-"`
	SourceCourse   Course `json:"sourceCourse" gorm:"foreignKey:SourceCourseID"`
	StatusID       uint   `json:"-"`
	Status         Status `json:"Status" gorm:"foreignKey:StatusID"`
}

Jump to

Keyboard shortcuts

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