Documentation ¶
Index ¶
- Constants
- Variables
- func GetNamespace(namespaceCache cache.NamespaceCache, req interface{}) string
- func MetricsScope(ctx context.Context, logger log.Logger) metrics.Scope
- type NamespaceCountLimitInterceptor
- type NamespaceIDGetter
- type NamespaceNameGetter
- type NamespaceRateLimitInterceptor
- type RateLimitInterceptor
- type TelemetryInterceptor
Constants ¶
View Source
const (
NamespaceRateLimitDefaultToken = 1
)
View Source
const (
RateLimitDefaultToken = 1
)
Variables ¶
View Source
var (
ErrNamespaceCountLimitServerBusy = serviceerror.NewResourceExhausted("namespace count limit exceeded")
)
View Source
var (
ErrNamespaceRateLimitServerBusy = serviceerror.NewResourceExhausted("namespace rate limit exceeded")
)
View Source
var (
RateLimitServerBusy = serviceerror.NewResourceExhausted("service rate limit exceeded")
)
Functions ¶
func GetNamespace ¶
func GetNamespace( namespaceCache cache.NamespaceCache, req interface{}, ) string
Types ¶
type NamespaceCountLimitInterceptor ¶
func NewNamespaceCountLimitInterceptor ¶
func NewNamespaceCountLimitInterceptor( namespaceCache cache.NamespaceCache, countFn func(namespace string) int, tokens map[string]int, ) *NamespaceCountLimitInterceptor
func (*NamespaceCountLimitInterceptor) Intercept ¶
func (ni *NamespaceCountLimitInterceptor) Intercept( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
type NamespaceIDGetter ¶ added in v1.8.1
type NamespaceIDGetter interface {
GetNamespaceId() string
}
gRPC method request must implement either NamespaceNameGetter or NamespaceIDGetter for namespace specific metrics to be reported properly
type NamespaceNameGetter ¶ added in v1.8.1
type NamespaceNameGetter interface {
GetNamespace() string
}
gRPC method request must implement either NamespaceNameGetter or NamespaceIDGetter for namespace specific metrics to be reported properly
type NamespaceRateLimitInterceptor ¶
type NamespaceRateLimitInterceptor struct {
// contains filtered or unexported fields
}
func NewNamespaceRateLimitInterceptor ¶
func NewNamespaceRateLimitInterceptor( namespaceCache cache.NamespaceCache, rateFn func(namespace string) float64, tokens map[string]int, ) *NamespaceRateLimitInterceptor
func (*NamespaceRateLimitInterceptor) Intercept ¶
func (ni *NamespaceRateLimitInterceptor) Intercept( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
type RateLimitInterceptor ¶
type RateLimitInterceptor struct {
// contains filtered or unexported fields
}
func NewRateLimitInterceptor ¶
func NewRateLimitInterceptor( rate quotas.RateFn, tokens map[string]int, ) *RateLimitInterceptor
func (*RateLimitInterceptor) Intercept ¶
func (i *RateLimitInterceptor) Intercept( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
type TelemetryInterceptor ¶
type TelemetryInterceptor struct {
// contains filtered or unexported fields
}
func NewTelemetryInterceptor ¶
func NewTelemetryInterceptor( namespaceCache cache.NamespaceCache, metricsClient metrics.Client, scopes map[string]int, logger log.Logger, ) *TelemetryInterceptor
func (*TelemetryInterceptor) Intercept ¶
func (ti *TelemetryInterceptor) Intercept( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.