tcpforwarding.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. CreatedAt time.Time
  13. UpdatedAt time.Time
  14. }
  15. func (m *Tcpforwarding) TableName() string {
  16. return "shd_waf_tcp"
  17. }
  18. type TcpForwardingRule struct {
  19. ID primitive.ObjectID `bson:"_id,omitempty"`
  20. Uid int `bson:"uid" json:"uid"`
  21. HostId int `bson:"host_id" json:"host_id"`
  22. TcpId int `bson:"tcp_id" json:"tcp_id"`
  23. CdnOriginIds map[string]int64 `bson:"cdn_origin_ids" json:"cdn_origin_ids"`
  24. BackendList []string `bson:"backend_list" json:"backend_list"`
  25. AllowIpList []string `bson:"allow_ip_list" json:"allow_ip_list"`
  26. DenyIpList []string `bson:"deny_ip_list" json:"deny_ip_list"`
  27. AccessRule string `bson:"access_rule" json:"access_rule"`
  28. CreatedAt time.Time `bson:"created_at" json:"created_at"`
  29. UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
  30. }
  31. func (m *TcpForwardingRule) CollectionName() string {
  32. return "tcp_forwarding_rules"
  33. }