o_container.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * @Author: LinkLeong link@icewhale.com
  3. * @Date: 2022-05-13 18:15:46
  4. * @LastEditors: LinkLeong
  5. * @LastEditTime: 2022-07-13 10:56:34
  6. * @FilePath: /CasaOS/service/model/o_container.go
  7. * @Description:
  8. * @Website: https://www.casaos.io
  9. * Copyright (c) 2022 by icewhale, All Rights Reserved.
  10. */
  11. package model
  12. const CONTAINERTABLENAME = "o_container"
  13. //Soon to be removed
  14. type AppListDBModel struct {
  15. CustomId string `gorm:"column:custom_id;primary_key" json:"custom_id"`
  16. Title string `json:"title"`
  17. // ScreenshotLink model.Strings `gorm:"type:json" json:"screenshot_link,omitempty"`
  18. ScreenshotLink string `json:"screenshot_link"`
  19. Slogan string `json:"slogan"`
  20. Description string `json:"description"`
  21. //Tags model.Strings `gorm:"type:json" json:"tags"`
  22. Tags string `json:"tags"`
  23. Icon string `json:"icon"`
  24. Version string `json:"version"`
  25. ContainerId string `json:"container_id,omitempty"`
  26. Image string `json:"image,omitempty"`
  27. Index string `json:"index"`
  28. CreatedAt string `gorm:"<-:create;autoCreateTime" json:"created_at"`
  29. UpdatedAt string `gorm:"<-:create;<-:update;autoUpdateTime" json:"updated_at"`
  30. //Port string `json:"port,omitempty"`
  31. PortMap string `json:"port_map"`
  32. Label string `json:"label"`
  33. EnableUPNP bool `json:"enable_upnp"`
  34. Envs string `json:"envs"`
  35. Ports string `json:"ports"`
  36. Volumes string `json:"volumes"`
  37. Devices string `json:"devices"`
  38. //Envs []model.Env `json:"envs"`
  39. //Ports []model.PortMap `gorm:"type:json" json:"ports"`
  40. //Volumes []model.PathMap `gorm:"type:json" json:"volumes"`
  41. //Devices []model.PathMap `gorm:"type:json" json:"device"`
  42. Position bool `json:"position"`
  43. NetModel string `json:"net_model"`
  44. CpuShares int64 `json:"cpu_shares"`
  45. Memory int64 `json:"memory"`
  46. Restart string `json:"restart"`
  47. //Rely model.MapStrings `gorm:"type:json" json:"rely"` //[{"mysql":"id"},{"mysql":"id"}]
  48. Origin string `json:"origin"`
  49. HostName string `json:"host_name"`
  50. Privileged bool `json:"privileged"`
  51. CapAdd string `json:"cap_add"`
  52. Cmd string `gorm:"type:json" json:"cmd"`
  53. }
  54. func (p *AppListDBModel) TableName() string {
  55. return "o_container"
  56. }
  57. type MyAppList struct {
  58. Id string `json:"id"`
  59. Name string `json:"name"`
  60. Icon string `json:"icon"`
  61. State string `json:"state"`
  62. CustomId string `gorm:"column:custom_id;primary_key" json:"custom_id"`
  63. Index string `json:"index"`
  64. //Order string `json:"order"`
  65. Port string `json:"port"`
  66. Slogan string `json:"slogan"`
  67. Type string `json:"type"`
  68. //Rely model.MapStrings `json:"rely"` //[{"mysql":"id"},{"mysql":"id"}]
  69. Image string `json:"image"`
  70. Volumes string `json:"volumes"`
  71. Latest bool `json:"latest"`
  72. Host string `json:"host"`
  73. Protocol string `json:"protocol"`
  74. }