Versions in this module Expand all Collapse all v1 v1.0.0 Oct 21, 2020 Changes in this version + func PromHandler(c *gin.Context) + func SentinelMiddleware(endPoint string, opts ...Option) gin.HandlerFunc + type Authorized struct + IPS []string + Resource string + type Awarent struct + func InitAwarent(entity Config) (*Awarent, error) + func (a *Awarent) ConfigOnChange(configID string) error + func (a *Awarent) Deregister() (bool, error) + func (a *Awarent) GetConfig(configID string) (string, error) + func (a *Awarent) IPFilter() gin.HandlerFunc + func (a *Awarent) LoadRules(rules ...FlowControlOption) (bool, error) + func (a *Awarent) Metrics() gin.HandlerFunc + func (a *Awarent) Register() (bool, error) + func (a *Awarent) Sentinel() gin.HandlerFunc + func (a *Awarent) Subscribe() error + type Awarenter interface + ConfigOnChange func(configID string) error + Deregister func() (bool, error) + GetConfig func(configID string) (string, error) + Register func() (bool, error) + type Config struct + ConfigID string + Group string + Nacos Nacos + Port uint64 + RuleID string + ServiceName string + type Filter struct + func New(opts FilterOptions) *Filter + func (f *Filter) Allowed(ip string) bool + func (f *Filter) Authorized(ip string, param string) bool + type FilterOptions struct + AllowedIPs []string + AuthorizedIPs []Authorized + BlockByDefault bool + BlockedIPs []string + URLParam string + URLPath string + type FlowControlOption struct + Resource string + Threshold float64 + type Nacos struct + IP string + Port uint64 + type Option func(*options) + func WithBlockFallback(fn func(ctx *gin.Context)) Option + func WithResourceExtractor(fn func(*gin.Context) string) Option + type Rule struct + FlowControlRules []FlowControlOption + IPFilterRules FilterOptions + ResourceParam string