udpforwarding.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package model
  2. import (
  3. "go.mongodb.org/mongo-driver/bson/primitive"
  4. "time"
  5. )
  6. type UdpForWarding 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 *UdpForWarding) TableName() string {
  17. return "shd_waf_udp"
  18. }
  19. // UdpForwardingRule 用于存储UDP转发规则
  20. type UdpForwardingRule struct {
  21. ID primitive.ObjectID `bson:"_id,omitempty"`
  22. Uid int `bson:"uid" json:"uid"`
  23. HostId int `bson:"host_id" json:"host_id"`
  24. UdpId int `bson:"udp_id" json:"udp_id"`
  25. CdnOriginIds map[string]int64 `bson:"cdn_origin_ids" json:"cdn_origin_ids"`
  26. BackendList []string `bson:"backend_list" json:"backend_list"`
  27. CreatedAt time.Time `bson:"created_at" json:"created_at"`
  28. UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
  29. }
  30. func (m *UdpForwardingRule) CollectionName() string {
  31. return "udp_forwarding_rules"
  32. }