Documentation ¶
Index ¶
Constants ¶
View Source
const (
Name = "counter"
)
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() eosc.IExtenderDriverFactory
func Register ¶
func Register(register eosc.IExtenderDriverRegister)
Types ¶
type Config ¶
type Config struct { Key string `json:"key" label:"格式化Key" required:"true"` Cache eosc.RequireId `json:"cache" label:"缓存计数器" skill:"github.com/eolinker/apinto/resources.resources.ICache" required:"false"` //Counter eosc.RequireId `json:"counter" label:"计数器" skill:"github.com/eolinker/apinto/drivers/counter.counter.IClient" required:"false"` //CountPusher eosc.RequireId `json:"counterPusher" label:"计数推送器" skill:"github.com/eolinker/apinto/drivers/counter.counter.ICountPusher" required:"false"` Match Match `json:"match" label:"响应匹配规则"` Count *separator.CountRule `json:"count" label:"计数规则"` }
type IKeyGenerator ¶
type IKeyGenerator interface { Key(ctx http_service.IHttpContext) string Variables(ctx http_service.IHttpContext) (eosc.Untyped[string, string], bool) }
type Match ¶
type Match struct { Params []*matcher.MatchParam `json:"params" label:"匹配参数列表"` StatusCodes []int `json:"status_codes" label:"匹配响应状态码列表"` Type string `json:"type" label:"匹配类型" enum:"json"` }
func (*Match) GenerateHandler ¶
type RedisCounter ¶
type RedisCounter struct {
// contains filtered or unexported fields
}
func NewRedisCounter ¶
func NewRedisCounter(key string, redis scope_manager.IProxyOutput[resources.ICache]) *RedisCounter
func (*RedisCounter) Complete ¶
func (r *RedisCounter) Complete(count int64) error
func (*RedisCounter) Lock ¶
func (r *RedisCounter) Lock(count int64) error
func (*RedisCounter) RollBack ¶
func (r *RedisCounter) RollBack(count int64) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.