v2

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 接口调用成功
	ExecuteSuccess Code = 200000
	// 接口调用成功
	ExecuteContinue Code = 200100
	// 针对HTTP接口,json转pb失败
	ParseException = 400001
	// 初始化接口,服务名不合法
	InvalidServiceName = 400201
	// 初始化接口,命名空间不合法
	InvalidNamespace = 400202
	// 初始化接口,客户端ID不合法
	InvalidClientId = 400203
	// 初始化接口,总配额数不合法
	InvalidTotalLimit = 400204
	// 初始化接口,总配额数不合法
	InvalidDuration = 400205
	// 初始化接口,滑窗数不合法
	InvalidSlideCount = 400206
	// 初始化接口,限流模式不合法
	InvalidMode = 400207
	// 限流接口,使用的配额不合法
	InvalidUsedLimit = 400211
	// 上报接口,时间戳不合法
	InvalidTimestamp = 400212
	// 上报接口,客户端标识不合法
	InvalidClientKey = 400213
	// 上报接口,计数器标识不合法
	InvalidCounterKey = 400214
	// 超过最大的counter限制
	ExceedMaxCounter = 401101
	// 超过最大的client限制
	ExceedMaxClient = 401102
	// 上报接口,找不到计数器
	NotFoundLimiter = 404001
	// 上报接口,找不到已注册的客户端
	NotFoundClient = 404002
)
View Source
const (
	APINameInit    = "v2.RateLimitGRPCV2/Service/Init"
	APINameAcquire = "v2.RateLimitGRPCV2/Service/Acquire"
)

Variables

This section is empty.

Functions

func GetErrorCode

func GetErrorCode(resp *ratelimiter.RateLimitResponse) uint32

GetErrorCode 返回错误码

Types

type ClientRateLimitReportRequest

type ClientRateLimitReportRequest struct {
	Service   string
	Namespace string
	Labels    string
	QuotaUsed map[time.Duration]*ratelimiter.QuotaSum
	Timestamp int64
}

ClientRateLimitReportRequest 客户端视角的上报请求

func NewClientRateLimitReportRequest

func NewClientRateLimitReportRequest() *ClientRateLimitReportRequest

NewClientRateLimitReportRequest 创建上报请求对象

type Code

type Code uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL