Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateCache ¶ added in v1.7.0
Types ¶
type SentinelEntity ¶
type SentinelEntity struct { app.SnowflakeIDModel app.SoftDeleteModel AppName string `gorm:"column:app_name" json:"AppName" form:"AppName" comment:"AppName"` DefaultAppType int `gorm:"column:app_type" json:"DefaultAppType" form:"DefaultAppType" comment:"DefaultAppType"` MetricHttpAddr string `gorm:"column:metric_http_addr" json:"MetricHttpAddr" form:"MetricHttpAddr" comment:"MetricHttpAddr"` MetricHttpPath string `gorm:"column:metric_http_path" json:"MetricHttpPath" form:"MetricHttpPath" comment:"MetricHttpPath"` CollectIntervalMs int `gorm:"column:collect_interval_ms" json:"CollectIntervalMs" form:"CollectIntervalMs" comment:"CollectIntervalMs"` Rules []SentinelRuleEntity `gorm:"foreignKey:sentinel_id;association_foreignkey:Id;constraint:OnCreate:CASCADE,OnUpdate:CASCADE,OnDelete:CASCADE;"` Status int `gorm:"column:status;default:0" json:"Status" form:"Status" comment:"状态"` }
func (SentinelEntity) TableName ¶
func (SentinelEntity) TableName() string
type SentinelRuleEntity ¶
type SentinelRuleEntity struct { app.SnowflakeIDModel app.SoftDeleteModel SentinelId int64 `gorm:"column:sentinel_id" json:"SentinelId" form:"SentinelId" comment:"SentinelId"` Resource string `gorm:"column:resource" json:"Resource" form:"Resource" comment:"Resource"` TokenCalculateStrategy string `` /* 131-byte string literal not displayed */ Threshold string `gorm:"column:threshold" json:"Threshold" form:"Threshold" comment:"Threshold"` ControlBehavior string `gorm:"column:control_behavior" json:"ControlBehavior" form:"ControlBehavior" comment:"ControlBehavior"` MaxQueueingTimeMs string `gorm:"column:max_queueing_time_ms" json:"MaxQueueingTimeMs" form:"MaxQueueingTimeMs" comment:"MaxQueueingTimeMs"` StatIntervalInMs string `gorm:"column:stat_interval_in_ms" json:"StatIntervalInMs" form:"StatIntervalInMs" comment:"StatIntervalInMs"` Status int `gorm:"column:status;default:0" json:"Status" form:"Status" comment:"状态"` }
func (SentinelRuleEntity) TableName ¶
func (SentinelRuleEntity) TableName() string
type ThrottleEntity ¶ added in v1.7.0
type ThrottleEntity struct { app.SnowflakeIDModel UserId int64 `json:"user_id,string"` // 用户ID Limit int `json:"limit"` // 并发限制 QueueSize int `json:"queue_size"` // 当前队列大小 MaxQueueSize int `json:"max_queue_size"` // 最大队列大小 WaitTime time.Duration `json:"wait_time"` // 请求的最大等待时间 }
func (*ThrottleEntity) AfterDelete ¶ added in v1.7.0
func (menu *ThrottleEntity) AfterDelete(tx *gorm.DB) (err error)
func (*ThrottleEntity) AfterSave ¶ added in v1.7.0
func (menu *ThrottleEntity) AfterSave(tx *gorm.DB) (err error)
func (ThrottleEntity) TableName ¶ added in v1.7.0
func (ThrottleEntity) TableName() string
Click to show internal directories.
Click to hide internal directories.