o_container.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package model
  2. const CONTAINERTABLENAME = "o_container"
  3. //Soon to be removed
  4. type AppListDBModel struct {
  5. CustomId string `gorm:"column:custom_id;primary_key" json:"custom_id"`
  6. Title string `json:"title"`
  7. // ScreenshotLink model.Strings `gorm:"type:json" json:"screenshot_link,omitempty"`
  8. ScreenshotLink string `json:"screenshot_link"`
  9. Slogan string `json:"slogan"`
  10. Description string `json:"description"`
  11. //Tags model.Strings `gorm:"type:json" json:"tags"`
  12. Tags string `json:"tags"`
  13. Icon string `json:"icon"`
  14. Version string `json:"version"`
  15. ContainerId string `json:"container_id,omitempty"`
  16. Image string `json:"image,omitempty"`
  17. Index string `json:"index"`
  18. CreatedAt string `gorm:"<-:create;autoCreateTime" json:"created_at"`
  19. UpdatedAt string `gorm:"<-:create;<-:update;autoUpdateTime" json:"updated_at"`
  20. //Port string `json:"port,omitempty"`
  21. PortMap string `json:"port_map"`
  22. Label string `json:"label"`
  23. EnableUPNP bool `json:"enable_upnp"`
  24. Envs string `json:"envs"`
  25. Ports string `json:"ports"`
  26. Volumes string `json:"volumes"`
  27. Devices string `json:"devices"`
  28. //Envs []model.Env `json:"envs"`
  29. //Ports []model.PortMap `gorm:"type:json" json:"ports"`
  30. //Volumes []model.PathMap `gorm:"type:json" json:"volumes"`
  31. //Devices []model.PathMap `gorm:"type:json" json:"device"`
  32. Position bool `json:"position"`
  33. NetModel string `json:"net_model"`
  34. CpuShares int64 `json:"cpu_shares"`
  35. Memory int64 `json:"memory"`
  36. Restart string `json:"restart"`
  37. //Rely model.MapStrings `gorm:"type:json" json:"rely"` //[{"mysql":"id"},{"mysql":"id"}]
  38. Origin string `json:"origin"`
  39. HostName string `json:"host_name"`
  40. Privileged bool `json:"privileged"`
  41. CapAdd string `json:"cap_add"`
  42. Cmd string `gorm:"type:json" json:"cmd"`
  43. }
  44. func (p *AppListDBModel) TableName() string {
  45. return "o_container"
  46. }
  47. type MyAppList struct {
  48. Id string `json:"id"`
  49. Name string `json:"name"`
  50. Icon string `json:"icon"`
  51. State string `json:"state"`
  52. CustomId string `gorm:"column:custom_id;primary_key" json:"custom_id"`
  53. Index string `json:"index"`
  54. //Order string `json:"order"`
  55. Port string `json:"port"`
  56. UpTime string `json:"up_time"`
  57. Slogan string `json:"slogan"`
  58. Type string `json:"type"`
  59. //Rely model.MapStrings `json:"rely"` //[{"mysql":"id"},{"mysql":"id"}]
  60. Image string `json:"image"`
  61. Volumes string `json:"volumes"`
  62. NewVersion bool `json:"new_version"`
  63. }