tcpforwarding.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package model
  2. import (
  3. "go.mongodb.org/mongo-driver/bson/primitive"
  4. "time"
  5. )
  6. type Tcpforwarding struct {
  7. Id int `gorm:"primary"`
  8. HostId int `gorm:"not null"`
  9. CdnWebId int `gorm:"not null"`
  10. Port string `gorm:"not null"`
  11. Comment string `gorm:"null"`
  12. Proxy bool `gorm:"not null"`
  13. CreatedAt time.Time
  14. UpdatedAt time.Time
  15. }
  16. func (m *Tcpforwarding) TableName() string {
  17. return "shd_waf_tcp"
  18. }
  19. type TcpForwardingRule struct {
  20. ID primitive.ObjectID `bson:"_id,omitempty"`
  21. Uid int `bson:"uid" json:"uid"`
  22. HostId int `bson:"host_id" json:"host_id"`
  23. TcpId int `bson:"tcp_id" json:"tcp_id"`
  24. CdnOriginIds map[string]int64 `bson:"cdn_origin_ids" json:"cdn_origin_ids"`
  25. BackendList []string `bson:"backend_list" json:"backend_list"`
  26. CreatedAt time.Time `bson:"created_at" json:"created_at"`
  27. UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
  28. }
  29. func (m *TcpForwardingRule) CollectionName() string {
  30. return "tcp_forwarding_rules"
  31. }