model

package
v0.0.0-...-b9d6e19 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpaceStatusDeleted = iota
	SpaceStatusAvailable
	SpaceStatusUncreated
)

Space的Status

View Source
const (
	RunningStatusStop = iota
	RunningStatusRunning
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RegisterInfo

type RegisterInfo struct {
	Nickname  string `json:"nickname"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Email     string `json:"email"`
	EmailCode string `json:"emailCode"`
}

type RunningSpace

type RunningSpace struct {
	Sid  string `json:"sid"`
	Host string `json:"host"`
}

type Space

type Space struct {
	Id            uint32        `json:"id" db:"id"`
	UserId        uint32        `json:"user_id" db:"user_id"` // 所属用户的id
	TmplId        uint32        `json:"tmpl_id" db:"tmpl_id"` // 模板的id
	SpecId        uint32        `json:"spec_id" db:"spec_id"` // 规格id
	Spec          SpaceSpec     `json:"spec"`
	Sid           string        `json:"sid" db:"sid"`   // 工作空间Id,用于访问时的url中
	Name          string        `json:"name" db:"name"` // 名称
	Status        uint32        `json:"-" db:"status"`  // 0 已删除  1 可用 2 未创建
	RunningStatus uint32        `json:"running_status"` // 0 停止  1 正在运行
	GitRepository string        `json:"git_repository" db:"git_repository"`
	CreateTime    time.Time     `json:"create_time" db:"create_time"`
	DeleteTime    time.Time     `json:"delete_time" db:"delete_time"`
	StopTime      time.Time     `json:"stop_time" db:"stop_time"`   // 停止时间
	TotalTime     time.Duration `json:"total_time" db:"total_time"` // 总运行时间
	Environment   string        `json:"environment"`
	Avatar        string        `json:"avatar"`
}

Space 用户根据模板创建的空间

type SpaceSpec

type SpaceSpec struct {
	Id          uint32 `json:"id" db:"id"`
	CpuSpec     string `json:"cpu_spec" db:"cpu_spec"`         // CPU规格
	MemSpec     string `json:"mem_spec" db:"mem_spec"`         // 内存规格
	StorageSpec string `json:"storage_spec" db:"storage_spec"` // 存储规格
	Name        string `json:"name" db:"name"`
	Desc        string `json:"desc" db:"desc"`
}

SpaceSpec 云空间的配置

type SpaceTemplate

type SpaceTemplate struct {
	Id         uint32    `json:"id" db:"id"`
	KindId     uint32    `json:"kind_id" db:"kind_id"` // 类别Id
	Name       string    `json:"name" db:"name"`       // 空间模板名称
	Desc       string    `json:"desc" db:"desc"`       // 描述
	Tags       string    `json:"tags" db:"tags"`       // 标签,使用|隔开
	Image      string    `json:"image" db:"image"`     // 镜像
	Status     uint32    `json:"status" db:"status"`   // 0可用 1 已删除
	Avatar     string    `json:"avatar" db:"avatar"`
	CreateTime time.Time `json:"create_time" db:"create_time"`
	DeleteTime time.Time `json:"delete_time" db:"delete_time"`
}

SpaceTemplate 云开发空间模板

type TmplKind

type TmplKind struct {
	Id   uint32 `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

type User

type User struct {
	Id         uint32    `json:"id" db:"id"`
	Uid        string    `json:"uid" db:"uid"`
	Username   string    `json:"username" db:"username"`
	Password   string    `json:"password" db:"password"`
	Nickname   string    `json:"nickname" db:"nickname"`
	Email      string    `json:"email" db:"email"`
	Phone      string    `json:"phone" db:"phone"`
	Avatar     string    `json:"avatar" db:"avatar"`
	CreateTime time.Time `json:"create_time" db:"create_time"`
	DeleteTime time.Time `json:"delete_time" db:"delete_time"`
	Status     uint32    `json:"status" db:"status"` // 状态 0正常 1已删除

	Token string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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