v2

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 6 Imported by: 1

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

View Source
var Mode_name = map[int32]string{
	0: "ADAPTIVE",
	1: "BATCH_OCCUPY",
	2: "BATCH_SHARE",
}
View Source
var Mode_value = map[string]int32{
	"ADAPTIVE":     0,
	"BATCH_OCCUPY": 1,
	"BATCH_SHARE":  2,
}
View Source
var QuotaMode_name = map[int32]string{
	0: "WHOLE",
	1: "DIVIDE",
}
View Source
var QuotaMode_value = map[string]int32{
	"WHOLE":  0,
	"DIVIDE": 1,
}
View Source
var RateLimitCmd_name = map[int32]string{
	0: "INIT",
	1: "ACQUIRE",
}
View Source
var RateLimitCmd_value = map[string]int32{
	"INIT":    0,
	"ACQUIRE": 1,
}

Functions

func GetErrorCode

func GetErrorCode(resp *RateLimitResponse) uint32

返回错误码

func RegisterRateLimitGRPCV2Server

func RegisterRateLimitGRPCV2Server(s *grpc.Server, srv RateLimitGRPCV2Server)

Types

type ClientRateLimitReportRequest

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

客户端视角的上报请求

func NewClientRateLimitReportRequest

func NewClientRateLimitReportRequest() *ClientRateLimitReportRequest

创建上报请求对象

type Code

type Code uint32

type LimitTarget

type LimitTarget struct {
	// 命名空间
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// 服务名
	Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	// 自定义标签
	Labels               string   `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

限流目标,针对哪部分数据进行限流

func (*LimitTarget) Descriptor

func (*LimitTarget) Descriptor() ([]byte, []int)

func (*LimitTarget) GetLabels

func (m *LimitTarget) GetLabels() string

func (*LimitTarget) GetNamespace

func (m *LimitTarget) GetNamespace() string

func (*LimitTarget) GetService

func (m *LimitTarget) GetService() string

func (*LimitTarget) ProtoMessage

func (*LimitTarget) ProtoMessage()

func (*LimitTarget) Reset

func (m *LimitTarget) Reset()

func (*LimitTarget) String

func (m *LimitTarget) String() string

func (*LimitTarget) XXX_DiscardUnknown

func (m *LimitTarget) XXX_DiscardUnknown()

func (*LimitTarget) XXX_Marshal

func (m *LimitTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LimitTarget) XXX_Merge

func (dst *LimitTarget) XXX_Merge(src proto.Message)

func (*LimitTarget) XXX_Size

func (m *LimitTarget) XXX_Size() int

func (*LimitTarget) XXX_Unmarshal

func (m *LimitTarget) XXX_Unmarshal(b []byte) error

type Mode

type Mode int32

限频模式

const (
	// 自适应模式,根据历史流量自动调整
	Mode_ADAPTIVE Mode = 0
	// 批量抢占模式,客户端进行拉取,Server返回全量剩余配额
	Mode_BATCH_OCCUPY Mode = 1
	// 批量分摊模式,客户端进行拉取,Server按比例进行分摊
	Mode_BATCH_SHARE Mode = 2
)

func (Mode) EnumDescriptor

func (Mode) EnumDescriptor() ([]byte, []int)

func (Mode) String

func (x Mode) String() string

type QuotaCounter

type QuotaCounter struct {
	// 单位秒
	Duration uint32 `protobuf:"varint,1,opt,name=duration,proto3" json:"duration,omitempty"`
	// bucket的标识,上报时候带入
	CounterKey uint32 `protobuf:"varint,2,opt,name=counterKey,proto3" json:"counterKey,omitempty"`
	// 剩余配额数,应答返回,允许为负数
	Left int64 `protobuf:"varint,3,opt,name=left,proto3" json:"left,omitempty"`
	// 实际限流模式
	Mode Mode `protobuf:"varint,4,opt,name=mode,proto3,enum=polaris.metric.v2.Mode" json:"mode,omitempty"`
	// 接入的客户端数量
	ClientCount          uint32   `protobuf:"varint,5,opt,name=clientCount,proto3" json:"clientCount,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

限流计数器

func (*QuotaCounter) Descriptor

func (*QuotaCounter) Descriptor() ([]byte, []int)

func (*QuotaCounter) GetClientCount

func (m *QuotaCounter) GetClientCount() uint32

func (*QuotaCounter) GetCounterKey

func (m *QuotaCounter) GetCounterKey() uint32

func (*QuotaCounter) GetDuration

func (m *QuotaCounter) GetDuration() uint32

func (*QuotaCounter) GetLeft

func (m *QuotaCounter) GetLeft() int64

func (*QuotaCounter) GetMode

func (m *QuotaCounter) GetMode() Mode

func (*QuotaCounter) ProtoMessage

func (*QuotaCounter) ProtoMessage()

func (*QuotaCounter) Reset

func (m *QuotaCounter) Reset()

func (*QuotaCounter) String

func (m *QuotaCounter) String() string

func (*QuotaCounter) XXX_DiscardUnknown

func (m *QuotaCounter) XXX_DiscardUnknown()

func (*QuotaCounter) XXX_Marshal

func (m *QuotaCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuotaCounter) XXX_Merge

func (dst *QuotaCounter) XXX_Merge(src proto.Message)

func (*QuotaCounter) XXX_Size

func (m *QuotaCounter) XXX_Size() int

func (*QuotaCounter) XXX_Unmarshal

func (m *QuotaCounter) XXX_Unmarshal(b []byte) error

type QuotaLeft

type QuotaLeft struct {
	// 计数器的标识,一个server全局唯一,上报时候带入
	CounterKey uint32 `protobuf:"varint,1,opt,name=counterKey,proto3" json:"counterKey,omitempty"`
	// 剩余配额数,应答返回,允许为负数
	Left int64 `protobuf:"varint,2,opt,name=left,proto3" json:"left,omitempty"`
	// 当前限流模式
	Mode Mode `protobuf:"varint,3,opt,name=mode,proto3,enum=polaris.metric.v2.Mode" json:"mode,omitempty"`
	// 接入的客户端数量
	ClientCount          uint32   `protobuf:"varint,4,opt,name=clientCount,proto3" json:"clientCount,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

客户端阈值使用统计,由服务端返回

func (*QuotaLeft) Descriptor

func (*QuotaLeft) Descriptor() ([]byte, []int)

func (*QuotaLeft) GetClientCount

func (m *QuotaLeft) GetClientCount() uint32

func (*QuotaLeft) GetCounterKey

func (m *QuotaLeft) GetCounterKey() uint32

func (*QuotaLeft) GetLeft

func (m *QuotaLeft) GetLeft() int64

func (*QuotaLeft) GetMode

func (m *QuotaLeft) GetMode() Mode

func (*QuotaLeft) ProtoMessage

func (*QuotaLeft) ProtoMessage()

func (*QuotaLeft) Reset

func (m *QuotaLeft) Reset()

func (*QuotaLeft) String

func (m *QuotaLeft) String() string

func (*QuotaLeft) XXX_DiscardUnknown

func (m *QuotaLeft) XXX_DiscardUnknown()

func (*QuotaLeft) XXX_Marshal

func (m *QuotaLeft) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuotaLeft) XXX_Merge

func (dst *QuotaLeft) XXX_Merge(src proto.Message)

func (*QuotaLeft) XXX_Size

func (m *QuotaLeft) XXX_Size() int

func (*QuotaLeft) XXX_Unmarshal

func (m *QuotaLeft) XXX_Unmarshal(b []byte) error

type QuotaMode

type QuotaMode int32

阈值模式

const (
	// 整体阈值
	QuotaMode_WHOLE QuotaMode = 0
	// 单机均分阈值
	QuotaMode_DIVIDE QuotaMode = 1
)

func (QuotaMode) EnumDescriptor

func (QuotaMode) EnumDescriptor() ([]byte, []int)

func (QuotaMode) String

func (x QuotaMode) String() string

type QuotaSum

type QuotaSum struct {
	// 计数器的标识,一个server全局唯一,上报时候带入
	CounterKey uint32 `protobuf:"varint,1,opt,name=counterKey,proto3" json:"counterKey,omitempty"`
	// 已使用的配额数,上报时候带入
	Used uint32 `protobuf:"varint,2,opt,name=used,proto3" json:"used,omitempty"`
	// 被限流数,上报时候带入
	Limited              uint32   `protobuf:"varint,3,opt,name=limited,proto3" json:"limited,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

客户端阈值使用统计

func (*QuotaSum) Descriptor

func (*QuotaSum) Descriptor() ([]byte, []int)

func (*QuotaSum) GetCounterKey

func (m *QuotaSum) GetCounterKey() uint32

func (*QuotaSum) GetLimited

func (m *QuotaSum) GetLimited() uint32

func (*QuotaSum) GetUsed

func (m *QuotaSum) GetUsed() uint32

func (*QuotaSum) ProtoMessage

func (*QuotaSum) ProtoMessage()

func (*QuotaSum) Reset

func (m *QuotaSum) Reset()

func (*QuotaSum) String

func (m *QuotaSum) String() string

func (*QuotaSum) XXX_DiscardUnknown

func (m *QuotaSum) XXX_DiscardUnknown()

func (*QuotaSum) XXX_Marshal

func (m *QuotaSum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuotaSum) XXX_Merge

func (dst *QuotaSum) XXX_Merge(src proto.Message)

func (*QuotaSum) XXX_Size

func (m *QuotaSum) XXX_Size() int

func (*QuotaSum) XXX_Unmarshal

func (m *QuotaSum) XXX_Unmarshal(b []byte) error

type QuotaTotal

type QuotaTotal struct {
	// 阈值模式
	Mode QuotaMode `protobuf:"varint,1,opt,name=mode,proto3,enum=polaris.metric.v2.QuotaMode" json:"mode,omitempty"`
	// 单位秒
	Duration uint32 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"`
	// 限流阈值
	MaxAmount            uint32   `protobuf:"varint,3,opt,name=maxAmount,proto3" json:"maxAmount,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

阈值配置的值

func (*QuotaTotal) Descriptor

func (*QuotaTotal) Descriptor() ([]byte, []int)

func (*QuotaTotal) GetDuration

func (m *QuotaTotal) GetDuration() uint32

func (*QuotaTotal) GetMaxAmount

func (m *QuotaTotal) GetMaxAmount() uint32

func (*QuotaTotal) GetMode

func (m *QuotaTotal) GetMode() QuotaMode

func (*QuotaTotal) ProtoMessage

func (*QuotaTotal) ProtoMessage()

func (*QuotaTotal) Reset

func (m *QuotaTotal) Reset()

func (*QuotaTotal) String

func (m *QuotaTotal) String() string

func (*QuotaTotal) XXX_DiscardUnknown

func (m *QuotaTotal) XXX_DiscardUnknown()

func (*QuotaTotal) XXX_Marshal

func (m *QuotaTotal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuotaTotal) XXX_Merge

func (dst *QuotaTotal) XXX_Merge(src proto.Message)

func (*QuotaTotal) XXX_Size

func (m *QuotaTotal) XXX_Size() int

func (*QuotaTotal) XXX_Unmarshal

func (m *QuotaTotal) XXX_Unmarshal(b []byte) error

type RateLimitCmd

type RateLimitCmd int32

命令字

const (
	RateLimitCmd_INIT    RateLimitCmd = 0
	RateLimitCmd_ACQUIRE RateLimitCmd = 1
)

func (RateLimitCmd) EnumDescriptor

func (RateLimitCmd) EnumDescriptor() ([]byte, []int)

func (RateLimitCmd) String

func (x RateLimitCmd) String() string

type RateLimitGRPCV2Client

type RateLimitGRPCV2Client interface {
	// 限流接口
	Service(ctx context.Context, opts ...grpc.CallOption) (RateLimitGRPCV2_ServiceClient, error)
	// 时间对齐接口
	TimeAdjust(ctx context.Context, in *TimeAdjustRequest, opts ...grpc.CallOption) (*TimeAdjustResponse, error)
}

RateLimitGRPCV2Client is the client API for RateLimitGRPCV2 service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRateLimitGRPCV2Client

func NewRateLimitGRPCV2Client(cc *grpc.ClientConn) RateLimitGRPCV2Client

type RateLimitGRPCV2Server

type RateLimitGRPCV2Server interface {
	// 限流接口
	Service(RateLimitGRPCV2_ServiceServer) error
	// 时间对齐接口
	TimeAdjust(context.Context, *TimeAdjustRequest) (*TimeAdjustResponse, error)
}

RateLimitGRPCV2Server is the server API for RateLimitGRPCV2 service.

type RateLimitGRPCV2_ServiceClient

type RateLimitGRPCV2_ServiceClient interface {
	Send(*RateLimitRequest) error
	Recv() (*RateLimitResponse, error)
	grpc.ClientStream
}

type RateLimitGRPCV2_ServiceServer

type RateLimitGRPCV2_ServiceServer interface {
	Send(*RateLimitResponse) error
	Recv() (*RateLimitRequest, error)
	grpc.ServerStream
}

type RateLimitInitRequest

type RateLimitInitRequest struct {
	// 限流目标对象数据
	Target *LimitTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	// 客户端唯一标识
	ClientId string `protobuf:"bytes,2,opt,name=clientId,proto3" json:"clientId,omitempty"`
	// 限流规则信息
	Totals []*QuotaTotal `protobuf:"bytes,3,rep,name=totals,proto3" json:"totals,omitempty"`
	// 客户端可指定滑窗数,不指定用默认值
	SlideCount uint32 `protobuf:"varint,4,opt,name=slideCount,proto3" json:"slideCount,omitempty"`
	// 限流模式
	Mode                 Mode     `protobuf:"varint,5,opt,name=mode,proto3,enum=polaris.metric.v2.Mode" json:"mode,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

初始化请求

func (*RateLimitInitRequest) Descriptor

func (*RateLimitInitRequest) Descriptor() ([]byte, []int)

func (*RateLimitInitRequest) GetClientId

func (m *RateLimitInitRequest) GetClientId() string

func (*RateLimitInitRequest) GetMode

func (m *RateLimitInitRequest) GetMode() Mode

func (*RateLimitInitRequest) GetSlideCount

func (m *RateLimitInitRequest) GetSlideCount() uint32

func (*RateLimitInitRequest) GetTarget

func (m *RateLimitInitRequest) GetTarget() *LimitTarget

func (*RateLimitInitRequest) GetTotals

func (m *RateLimitInitRequest) GetTotals() []*QuotaTotal

func (*RateLimitInitRequest) ProtoMessage

func (*RateLimitInitRequest) ProtoMessage()

func (*RateLimitInitRequest) Reset

func (m *RateLimitInitRequest) Reset()

func (*RateLimitInitRequest) String

func (m *RateLimitInitRequest) String() string

func (*RateLimitInitRequest) XXX_DiscardUnknown

func (m *RateLimitInitRequest) XXX_DiscardUnknown()

func (*RateLimitInitRequest) XXX_Marshal

func (m *RateLimitInitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitInitRequest) XXX_Merge

func (dst *RateLimitInitRequest) XXX_Merge(src proto.Message)

func (*RateLimitInitRequest) XXX_Size

func (m *RateLimitInitRequest) XXX_Size() int

func (*RateLimitInitRequest) XXX_Unmarshal

func (m *RateLimitInitRequest) XXX_Unmarshal(b []byte) error

type RateLimitInitResponse

type RateLimitInitResponse struct {
	// 应答错误码
	Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// 限流目标对象,回传给客户端
	Target *LimitTarget `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
	// 客户端的标识,与clientId对应,一个server全局唯一,上报时候带入
	ClientKey uint32 `protobuf:"varint,3,opt,name=clientKey,proto3" json:"clientKey,omitempty"`
	// 计数器的标识
	Counters []*QuotaCounter `protobuf:"bytes,5,rep,name=counters,proto3" json:"counters,omitempty"`
	// 实际滑窗个数
	SlideCount uint32 `protobuf:"varint,6,opt,name=slideCount,proto3" json:"slideCount,omitempty"`
	// 限流server绝对时间,单位ms
	Timestamp            int64    `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

初始化应答

func (*RateLimitInitResponse) Descriptor

func (*RateLimitInitResponse) Descriptor() ([]byte, []int)

func (*RateLimitInitResponse) GetClientKey

func (m *RateLimitInitResponse) GetClientKey() uint32

func (*RateLimitInitResponse) GetCode

func (m *RateLimitInitResponse) GetCode() uint32

func (*RateLimitInitResponse) GetCounters

func (m *RateLimitInitResponse) GetCounters() []*QuotaCounter

func (*RateLimitInitResponse) GetSlideCount

func (m *RateLimitInitResponse) GetSlideCount() uint32

func (*RateLimitInitResponse) GetTarget

func (m *RateLimitInitResponse) GetTarget() *LimitTarget

func (*RateLimitInitResponse) GetTimestamp

func (m *RateLimitInitResponse) GetTimestamp() int64

func (*RateLimitInitResponse) ProtoMessage

func (*RateLimitInitResponse) ProtoMessage()

func (*RateLimitInitResponse) Reset

func (m *RateLimitInitResponse) Reset()

func (*RateLimitInitResponse) String

func (m *RateLimitInitResponse) String() string

func (*RateLimitInitResponse) XXX_DiscardUnknown

func (m *RateLimitInitResponse) XXX_DiscardUnknown()

func (*RateLimitInitResponse) XXX_Marshal

func (m *RateLimitInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitInitResponse) XXX_Merge

func (dst *RateLimitInitResponse) XXX_Merge(src proto.Message)

func (*RateLimitInitResponse) XXX_Size

func (m *RateLimitInitResponse) XXX_Size() int

func (*RateLimitInitResponse) XXX_Unmarshal

func (m *RateLimitInitResponse) XXX_Unmarshal(b []byte) error

type RateLimitReportRequest

type RateLimitReportRequest struct {
	// 客户端标识
	ClientKey uint32 `protobuf:"varint,1,opt,name=clientKey,proto3" json:"clientKey,omitempty"`
	// 已使用的配额数
	QuotaUses []*QuotaSum `protobuf:"bytes,2,rep,name=quotaUses,proto3" json:"quotaUses,omitempty"`
	// 配额发生的时间,单位ms
	Timestamp            int64    `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

限流上报请求

func (*RateLimitReportRequest) Descriptor

func (*RateLimitReportRequest) Descriptor() ([]byte, []int)

func (*RateLimitReportRequest) GetClientKey

func (m *RateLimitReportRequest) GetClientKey() uint32

func (*RateLimitReportRequest) GetQuotaUses

func (m *RateLimitReportRequest) GetQuotaUses() []*QuotaSum

func (*RateLimitReportRequest) GetTimestamp

func (m *RateLimitReportRequest) GetTimestamp() int64

func (*RateLimitReportRequest) ProtoMessage

func (*RateLimitReportRequest) ProtoMessage()

func (*RateLimitReportRequest) Reset

func (m *RateLimitReportRequest) Reset()

func (*RateLimitReportRequest) String

func (m *RateLimitReportRequest) String() string

func (*RateLimitReportRequest) XXX_DiscardUnknown

func (m *RateLimitReportRequest) XXX_DiscardUnknown()

func (*RateLimitReportRequest) XXX_Marshal

func (m *RateLimitReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitReportRequest) XXX_Merge

func (dst *RateLimitReportRequest) XXX_Merge(src proto.Message)

func (*RateLimitReportRequest) XXX_Size

func (m *RateLimitReportRequest) XXX_Size() int

func (*RateLimitReportRequest) XXX_Unmarshal

func (m *RateLimitReportRequest) XXX_Unmarshal(b []byte) error

type RateLimitReportResponse

type RateLimitReportResponse struct {
	Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// 剩余配额数
	QuotaLefts []*QuotaLeft `protobuf:"bytes,2,rep,name=quotaLefts,proto3" json:"quotaLefts,omitempty"`
	// 限流server绝对时间,单位ms
	Timestamp            int64    `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

限流上报应答

func (*RateLimitReportResponse) Descriptor

func (*RateLimitReportResponse) Descriptor() ([]byte, []int)

func (*RateLimitReportResponse) GetCode

func (m *RateLimitReportResponse) GetCode() uint32

func (*RateLimitReportResponse) GetQuotaLefts

func (m *RateLimitReportResponse) GetQuotaLefts() []*QuotaLeft

func (*RateLimitReportResponse) GetTimestamp

func (m *RateLimitReportResponse) GetTimestamp() int64

func (*RateLimitReportResponse) ProtoMessage

func (*RateLimitReportResponse) ProtoMessage()

func (*RateLimitReportResponse) Reset

func (m *RateLimitReportResponse) Reset()

func (*RateLimitReportResponse) String

func (m *RateLimitReportResponse) String() string

func (*RateLimitReportResponse) XXX_DiscardUnknown

func (m *RateLimitReportResponse) XXX_DiscardUnknown()

func (*RateLimitReportResponse) XXX_Marshal

func (m *RateLimitReportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitReportResponse) XXX_Merge

func (dst *RateLimitReportResponse) XXX_Merge(src proto.Message)

func (*RateLimitReportResponse) XXX_Size

func (m *RateLimitReportResponse) XXX_Size() int

func (*RateLimitReportResponse) XXX_Unmarshal

func (m *RateLimitReportResponse) XXX_Unmarshal(b []byte) error

type RateLimitRequest

type RateLimitRequest struct {
	// 命令字
	Cmd RateLimitCmd `protobuf:"varint,1,opt,name=cmd,proto3,enum=polaris.metric.v2.RateLimitCmd" json:"cmd,omitempty"`
	// 初始化请求
	RateLimitInitRequest *RateLimitInitRequest `protobuf:"bytes,2,opt,name=rateLimitInitRequest,proto3" json:"rateLimitInitRequest,omitempty"`
	// 上报请求
	RateLimitReportRequest *RateLimitReportRequest `protobuf:"bytes,3,opt,name=rateLimitReportRequest,proto3" json:"rateLimitReportRequest,omitempty"`
	XXX_NoUnkeyedLiteral   struct{}                `json:"-"`
	XXX_unrecognized       []byte                  `json:"-"`
	XXX_sizecache          int32                   `json:"-"`
}

限流请求

func (*RateLimitRequest) Descriptor

func (*RateLimitRequest) Descriptor() ([]byte, []int)

func (*RateLimitRequest) GetCmd

func (m *RateLimitRequest) GetCmd() RateLimitCmd

func (*RateLimitRequest) GetRateLimitInitRequest

func (m *RateLimitRequest) GetRateLimitInitRequest() *RateLimitInitRequest

func (*RateLimitRequest) GetRateLimitReportRequest

func (m *RateLimitRequest) GetRateLimitReportRequest() *RateLimitReportRequest

func (*RateLimitRequest) ProtoMessage

func (*RateLimitRequest) ProtoMessage()

func (*RateLimitRequest) Reset

func (m *RateLimitRequest) Reset()

func (*RateLimitRequest) String

func (m *RateLimitRequest) String() string

func (*RateLimitRequest) XXX_DiscardUnknown

func (m *RateLimitRequest) XXX_DiscardUnknown()

func (*RateLimitRequest) XXX_Marshal

func (m *RateLimitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitRequest) XXX_Merge

func (dst *RateLimitRequest) XXX_Merge(src proto.Message)

func (*RateLimitRequest) XXX_Size

func (m *RateLimitRequest) XXX_Size() int

func (*RateLimitRequest) XXX_Unmarshal

func (m *RateLimitRequest) XXX_Unmarshal(b []byte) error

type RateLimitResponse

type RateLimitResponse struct {
	// 命令字
	Cmd RateLimitCmd `protobuf:"varint,1,opt,name=cmd,proto3,enum=polaris.metric.v2.RateLimitCmd" json:"cmd,omitempty"`
	// 初始化请求
	RateLimitInitResponse *RateLimitInitResponse `protobuf:"bytes,2,opt,name=rateLimitInitResponse,proto3" json:"rateLimitInitResponse,omitempty"`
	// 上报请求
	RateLimitReportResponse *RateLimitReportResponse `protobuf:"bytes,3,opt,name=rateLimitReportResponse,proto3" json:"rateLimitReportResponse,omitempty"`
	XXX_NoUnkeyedLiteral    struct{}                 `json:"-"`
	XXX_unrecognized        []byte                   `json:"-"`
	XXX_sizecache           int32                    `json:"-"`
}

限流应答

func (*RateLimitResponse) Descriptor

func (*RateLimitResponse) Descriptor() ([]byte, []int)

func (*RateLimitResponse) GetCmd

func (m *RateLimitResponse) GetCmd() RateLimitCmd

func (*RateLimitResponse) GetRateLimitInitResponse

func (m *RateLimitResponse) GetRateLimitInitResponse() *RateLimitInitResponse

func (*RateLimitResponse) GetRateLimitReportResponse

func (m *RateLimitResponse) GetRateLimitReportResponse() *RateLimitReportResponse

func (*RateLimitResponse) ProtoMessage

func (*RateLimitResponse) ProtoMessage()

func (*RateLimitResponse) Reset

func (m *RateLimitResponse) Reset()

func (*RateLimitResponse) String

func (m *RateLimitResponse) String() string

func (*RateLimitResponse) XXX_DiscardUnknown

func (m *RateLimitResponse) XXX_DiscardUnknown()

func (*RateLimitResponse) XXX_Marshal

func (m *RateLimitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RateLimitResponse) XXX_Merge

func (dst *RateLimitResponse) XXX_Merge(src proto.Message)

func (*RateLimitResponse) XXX_Size

func (m *RateLimitResponse) XXX_Size() int

func (*RateLimitResponse) XXX_Unmarshal

func (m *RateLimitResponse) XXX_Unmarshal(b []byte) error

type TimeAdjustRequest

type TimeAdjustRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

时间点对齐的请求

func (*TimeAdjustRequest) Descriptor

func (*TimeAdjustRequest) Descriptor() ([]byte, []int)

func (*TimeAdjustRequest) ProtoMessage

func (*TimeAdjustRequest) ProtoMessage()

func (*TimeAdjustRequest) Reset

func (m *TimeAdjustRequest) Reset()

func (*TimeAdjustRequest) String

func (m *TimeAdjustRequest) String() string

func (*TimeAdjustRequest) XXX_DiscardUnknown

func (m *TimeAdjustRequest) XXX_DiscardUnknown()

func (*TimeAdjustRequest) XXX_Marshal

func (m *TimeAdjustRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimeAdjustRequest) XXX_Merge

func (dst *TimeAdjustRequest) XXX_Merge(src proto.Message)

func (*TimeAdjustRequest) XXX_Size

func (m *TimeAdjustRequest) XXX_Size() int

func (*TimeAdjustRequest) XXX_Unmarshal

func (m *TimeAdjustRequest) XXX_Unmarshal(b []byte) error

type TimeAdjustResponse

type TimeAdjustResponse struct {
	// 服务器时间点,毫秒
	ServerTimestamp      int64    `protobuf:"varint,1,opt,name=serverTimestamp,proto3" json:"serverTimestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

时间点对齐的应答

func (*TimeAdjustResponse) Descriptor

func (*TimeAdjustResponse) Descriptor() ([]byte, []int)

func (*TimeAdjustResponse) GetServerTimestamp

func (m *TimeAdjustResponse) GetServerTimestamp() int64

func (*TimeAdjustResponse) ProtoMessage

func (*TimeAdjustResponse) ProtoMessage()

func (*TimeAdjustResponse) Reset

func (m *TimeAdjustResponse) Reset()

func (*TimeAdjustResponse) String

func (m *TimeAdjustResponse) String() string

func (*TimeAdjustResponse) XXX_DiscardUnknown

func (m *TimeAdjustResponse) XXX_DiscardUnknown()

func (*TimeAdjustResponse) XXX_Marshal

func (m *TimeAdjustResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimeAdjustResponse) XXX_Merge

func (dst *TimeAdjustResponse) XXX_Merge(src proto.Message)

func (*TimeAdjustResponse) XXX_Size

func (m *TimeAdjustResponse) XXX_Size() int

func (*TimeAdjustResponse) XXX_Unmarshal

func (m *TimeAdjustResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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