Documentation ¶
Overview ¶
@Author: link a624669980@163.com
*@Date: 2022-05-16 17:37:08 *@LastEditors: LinkLeong *@LastEditTime: 2022-07-13 10:46:38 *@FilePath: /CasaOS/model/category.go *@Description:
@Author: LinkLeong link@icewhale.com
*@Date: 2021-12-08 18:10:25 *@LastEditors: LinkLeong *@LastEditTime: 2022-07-13 10:49:16 *@FilePath: /CasaOS/model/docker.go *@Description: *@Website: https://www.casaos.io *Copyright (c) 2022 by icewhale, All Rights Reserved.
Index ¶
- type APPModel
- type CasaOSGlobalVariables
- type CategoryList
- type CommonModel
- type CustomizationPostData
- type Devices
- type DockerDaemonConfigurationModel
- type DockerStatsModel
- type Env
- type EnvArray
- type Envs
- type JSON
- type MapStrings
- type MyAppList
- type PathArray
- type PathMap
- type PortArray
- type PortMap
- type Ports
- type ServerAppList
- type ServerAppListCollection
- type ServerCategoryList
- type ServerModel
- type StateEnum
- type Strings
- type TCPPorts
- type UDPPorts
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasaOSGlobalVariables ¶
type CasaOSGlobalVariables struct {
AppChange bool
}
type CategoryList ¶
type CategoryList struct { ID uint `gorm:"column:id;primary_key" json:"id"` //CreatedAt time.Time `json:"created_at"` // //UpdatedAt time.Time `json:"updated_at"` Font string `json:"font"` // @tiger - 如果这个和前端有关,应该不属于后端的出参范围,而是前端去界定 Name string `json:"name"` Count uint `json:"count"` // @tiger - count 属于动态信息,应该单独放在一个出参结构中(原因见另外一个关于 静态/动态 出参的注释) }
type CommonModel ¶
type CommonModel struct {
RuntimePath string
}
type CustomizationPostData ¶
type CustomizationPostData struct { ContainerName string `json:"container_name"` CustomID string `json:"custom_id"` Origin string `json:"origin"` NetworkModel string `json:"network_model"` Index string `json:"index"` Icon string `json:"icon"` Image string `json:"image"` Envs EnvArray `json:"envs"` Ports PortArray `json:"ports"` Volumes PathArray `json:"volumes"` Devices PathArray `json:"devices"` // Port string `json:"port,omitempty"` PortMap string `json:"port_map"` Memory int64 `json:"memory"` Restart string `json:"restart"` EnableUPNP bool `json:"enable_upnp"` Label string `json:"label"` Description string `json:"description"` Position bool `json:"position"` HostName string `json:"host_name"` Privileged bool `json:"privileged"` CapAdd []string `json:"cap_add"` Cmd []string `json:"cmd"` Protocol string `json:"protocol"` Host string `json:"host"` }
type DockerDaemonConfigurationModel ¶
type DockerDaemonConfigurationModel struct { // e.g. `/var/lib/docker` Root string `json:"data-root,omitempty"` }
reference - https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
type DockerStatsModel ¶
type JSON ¶
type JSON jsoniter.RawMessage
type MapStrings ¶
***************使gorm支持[]string结构******************
func (*MapStrings) Scan ¶
func (c *MapStrings) Scan(input interface{}) error
type MyAppList ¶
type MyAppList struct { ID string `json:"id"` Name string `json:"name"` Icon string `json:"icon"` State string `json:"state"` CustomID string `gorm:"column:custom_id;primary_key" json:"custom_id"` Index string `json:"index"` Port string `json:"port"` Slogan string `json:"slogan"` Type string `json:"type"` Image string `json:"image"` Volumes string `json:"volumes"` Latest bool `json:"latest"` Host string `json:"host"` Protocol string `json:"protocol"` Created int64 `json:"created"` }
type ServerAppList ¶
type ServerAppList struct { ID uint `gorm:"column:id;primary_key" json:"id"` Title string `json:"title"` Description string `json:"description"` Tagline string `json:"tagline"` Tags Strings `gorm:"type:json" json:"tags"` Icon string `json:"icon"` ScreenshotLink Strings `gorm:"type:json" json:"screenshot_link"` Category string `json:"category"` CategoryID int `json:"category_id"` CategoryFont string `json:"category_font"` PortMap string `json:"port_map"` ImageVersion string `json:"image_version"` Tip string `json:"tip"` Envs EnvArray `json:"envs"` Ports PortArray `json:"ports"` Volumes PathArray `json:"volumes"` Devices PathArray `json:"devices"` NetworkModel string `json:"network_model"` Image string `json:"image"` Index string `json:"index"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` State StateEnum `json:"state"` Author string `json:"author"` MinMemory int `json:"min_memory"` MinDisk int `json:"min_disk"` Thumbnail string `json:"thumbnail"` Healthy string `json:"healthy"` Plugins Strings `json:"plugins"` Origin string `json:"origin"` Type int `json:"type"` QueryCount int `json:"query_count"` Developer string `json:"developer"` HostName string `json:"host_name"` Privileged bool `json:"privileged"` CapAdd Strings `json:"cap_add"` Cmd Strings `json:"cmd"` }
@tiger - 对于用于出参的数据结构,静态信息(例如 title)和
动态信息(例如 state、query_count)应该划分到不同的数据结构中 这样的好处是 1 - 多次获取动态信息时可以减少出参复杂度,因为静态信息只获取一次就好 2 - 在未来的迭代中,可以降低维护成本(所有字段都展开放在一个层级维护成本略高) 另外,一些针对性字段,例如 Docker 相关的,可以用 map 来保存。 这样在未来增加多态 App,例如 Snap,不需要维护多个结构,或者一个结构保存不必要的字段
type ServerAppListCollection ¶
type ServerAppListCollection struct { List []ServerAppList `json:"list"` Recommend []ServerAppList `json:"recommend"` Community []ServerAppList `json:"community"` }
type ServerCategoryList ¶
type ServerCategoryList struct {
Item []CategoryList `json:"item"`
}
type ServerModel ¶
type ServerModel struct {
ServerAPI string
}
Click to show internal directories.
Click to hide internal directories.