Documentation ¶
Index ¶
- func DeleteApp(id uint) error
- func DeleteService(id uint) error
- func DeleteUser(id uint) error
- func DeleteVersion(id uint) error
- func GetSelfDB() *gorm.DB
- func InitRWDB() *gorm.DB
- type App
- type BasicModel
- type Container
- type Database
- type Env
- type MAEDeployment
- type MAEService
- type PortPair
- type ReqVersion
- type Service
- type User
- type Version
- type VersionConfig
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteService ¶
DeleteService deletes the service by the service id.
func DeleteUser ¶
DeleteUser deletes the user by the user identifier.
func DeleteVersion ¶
DeleteVersion deletes the version by the version id.
Types ¶
type App ¶
type App struct { BasicModel AppName string `json:"app_name" gorm:"column:app_name;not null;unique;type:varchar(50)"` AppDesc string `json:"app_desc" gorm:"column:app_desc;type:varchar(512)"` Services []Service `gorm:"foreignkey:AppID"` //App表不会多任何字段,Service表会多app_id }
func GetAppByID ¶
func GetAppByName ¶
type BasicModel ¶
type MAEDeployment ¶
type MAEService ¶
type ReqVersion ¶
type ReqVersion struct { ServiceID uint `json:"svc_id"` VersionName string `json:"version_name"` VersionDesc string `json:"version_desc"` VersionConf VersionConfig `json:"version_conf"` }
type Service ¶
type Service struct { BasicModel AppID uint `json:"app_id" gorm:"column:app_id;not null"` SvcName string `json:"svc_name" gorm:"column:svc_name;not null;unique;type:varchar(50)"` SvcDesc string `json:"svc_desc" gorm:"column:svc_desc;type:varchar(512)"` CurrentVersion string `json:"current_version" gorm:"column:current_version"` Versions []Version `gorm:"foreignkey:ServiceID"` //service表不会多任何字段,Version表多一个ServiceID }
func GetServiceByID ¶
func GetServiceByName ¶
func ListService ¶
ListService List all services
func ListServiceByAppID ¶
List all service belongs to an app
type User ¶
type User struct { BasicModel UserName string `json:"username" gorm:"column:username;not null;unique"` Email string `json:"email" gorm:"column:email;not null;unique"` PasswordHash string `json:"password" gorm:"column:passwordhash;not null"` Confirm bool `json:"confirm" gorm:"column:confirm;default:false"` Role string `json:"role" gorm:"column:role;default:'user'"` }
func GetUserByEmail ¶
GetUser gets an user by the user's email.
func GetUserByName ¶
GetUser gets an user by the user name.
type Version ¶
type Version struct { BasicModel ServiceID uint `json:"svc_id" gorm:"column:svc_id;not null"` Active bool `json:"active" gorm:"column:active;default:false"` VersionName string `json:"version_name" gorm:"column:version_name;type:varchar(50)"` VersionDesc string `json:"version_desc" gorm:"column:version_desc;type:varchar(512)"` VersionConfig string `json:"version_conf" gorm:"column:version_conf;type:varchar(4096)"` }
func GetVersionByID ¶
func GetVersionByName ¶
func ListVersion ¶
ListVersion List all versions
func ListVersionByServiceID ¶
List all versions belongs to a service
type VersionConfig ¶
type VersionConfig struct { Deployment MAEDeployment `json:"deployment"` Svc MAEService `json:"svc"` //此处的Svc指的是k8s中的Service的概念 }
type Volume ¶
type Volume struct { VolumeName string `json:"volume_name"` ReadOnly bool `json:"read_only"` HostPath string `json:"host_path"` //https://kubernetes.io/docs/concepts/storage/volumes/#hostpath HostPathType apiv1.HostPathType `json:"host_path_type"` TargetPath string `json:"target_path"` }
Click to show internal directories.
Click to hide internal directories.