You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

scnodeavailinfomodel_gen.go 3.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Code generated by goctl. DO NOT EDIT.
  2. package model
  3. import (
  4. "context"
  5. "database/sql"
  6. "strings"
  7. "time"
  8. "github.com/zeromicro/go-zero/core/stores/builder"
  9. "github.com/zeromicro/go-zero/core/stores/cache"
  10. "github.com/zeromicro/go-zero/core/stores/sqlc"
  11. "github.com/zeromicro/go-zero/core/stores/sqlx"
  12. "github.com/zeromicro/go-zero/core/stringx"
  13. )
  14. var (
  15. scNodeAvailInfoFieldNames = builder.RawFieldNames(&ScNodeAvailInfo{})
  16. scNodeAvailInfoRows = strings.Join(scNodeAvailInfoFieldNames, ",")
  17. scNodeAvailInfoRowsExpectAutoSet = strings.Join(stringx.Remove(scNodeAvailInfoFieldNames, "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
  18. scNodeAvailInfoRowsWithPlaceHolder = strings.Join(stringx.Remove(scNodeAvailInfoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
  19. cachePcmScNodeAvailInfoIdPrefix = "cache:pcm:scNodeAvailInfo:id:"
  20. )
  21. type (
  22. scNodeAvailInfoModel interface {
  23. Insert(ctx context.Context, data *ScNodeAvailInfo) (sql.Result, error)
  24. FindOne(ctx context.Context, id int64) (*ScNodeAvailInfo, error)
  25. Update(ctx context.Context, data *ScNodeAvailInfo) error
  26. Delete(ctx context.Context, id int64) error
  27. }
  28. defaultScNodeAvailInfoModel struct {
  29. sqlc.CachedConn
  30. table string
  31. }
  32. ScNodeAvailInfo struct {
  33. Id int64 `db:"id"` // id
  34. NodeName string `db:"node_name"` // 节点名称
  35. CpuTotal int64 `db:"cpu_total"` // cpu核数
  36. CpuUsable float64 `db:"cpu_usable"` // cpu可用率
  37. DiskTotal int64 `db:"disk_total"` // 磁盘空间
  38. DiskAvail int64 `db:"disk_avail"` // 磁盘可用空间
  39. MemTotal int64 `db:"mem_total"` // 内存总数
  40. MemAvail int64 `db:"mem_avail"` // 内存可用数
  41. GpuTotal int64 `db:"gpu_total"` // gpu总数
  42. GpuAvail int64 `db:"gpu_avail"` // gpu可用数
  43. ClusterLogicId int64 `db:"cluster_logic_id"` // 集群静态信息id
  44. DeletedFlag int64 `db:"deleted_flag"` // 是否删除
  45. CreatedBy int64 `db:"created_by"` // 创建人
  46. CreatedTime time.Time `db:"created_time"` // 创建时间
  47. UpdatedBy int64 `db:"updated_by"` // 更新人
  48. UpdatedTime time.Time `db:"updated_time"` // 更新时间
  49. }
  50. )
  51. func newScNodeAvailInfoModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) *defaultScNodeAvailInfoModel {
  52. return &defaultScNodeAvailInfoModel{
  53. CachedConn: sqlc.NewConn(conn, c, opts...),
  54. table: "`sc_node_avail_info`",
  55. }
  56. }
  57. func (m *defaultScNodeAvailInfoModel) withSession(session sqlx.Session) *defaultScNodeAvailInfoModel {
  58. return &defaultScNodeAvailInfoModel{
  59. CachedConn: m.CachedConn.WithSession(session),
  60. table: "`sc_node_avail_info`",
  61. }
  62. }
  63. func (m *defaultScNodeAvailInfoModel) tableName() string {
  64. return m.table
  65. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.