Versions in this module Expand all Collapse all v0 v0.1.3 Aug 2, 2022 v0.1.2 Jul 29, 2022 Changes in this version + const AcquireQuotaError + const CreateLimiterError + const ExecuteSuccess + const InvalidNamespace + const InvalidRatelimitKey + const InvalidServiceName + const InvalidTimestamp + const InvalidTotalLimit + const InvalidUsedLimit + const NotFoundLimiter + const ParseException + var Code2Info = map[Code]*wrappers.StringValue + var MetricKey_Role_name = map[int32]string + var MetricKey_Role_value = map[string]int32 + var MetricType_name = map[int32]string + var MetricType_value = map[string]int32 + var WrapperCode = map[Code]*wrappers.UInt32Value + func Code2HTTPStatus(code Code) int + func RegisterMetricGRPCServer(s *grpc.Server, srv MetricGRPCServer) + func RegisterRateLimitGRPCServer(s *grpc.Server, srv RateLimitGRPCServer) + type Code uint32 + type Limiter struct + Amount *google_protobuf.UInt32Value + Duration *google_protobuf1.Duration + Limited *google_protobuf.UInt32Value + func (*Limiter) Descriptor() ([]byte, []int) + func (*Limiter) ProtoMessage() + func (m *Limiter) GetAmount() *google_protobuf.UInt32Value + func (m *Limiter) GetDuration() *google_protobuf1.Duration + func (m *Limiter) GetLimited() *google_protobuf.UInt32Value + func (m *Limiter) Reset() + func (m *Limiter) String() string + type MetricDimension struct + Type MetricType + Value string + func (*MetricDimension) Descriptor() ([]byte, []int) + func (*MetricDimension) ProtoMessage() + func (m *MetricDimension) GetType() MetricType + func (m *MetricDimension) GetValue() string + func (m *MetricDimension) Reset() + func (m *MetricDimension) String() string + type MetricGRPCClient interface + Init func(ctx context.Context, in *MetricInitRequest, opts ...grpc.CallOption) (*MetricResponse, error) + Query func(ctx context.Context, opts ...grpc.CallOption) (MetricGRPC_QueryClient, error) + Report func(ctx context.Context, opts ...grpc.CallOption) (MetricGRPC_ReportClient, error) + func NewMetricGRPCClient(cc *grpc.ClientConn) MetricGRPCClient + type MetricGRPCServer interface + Init func(context.Context, *MetricInitRequest) (*MetricResponse, error) + Query func(MetricGRPC_QueryServer) error + Report func(MetricGRPC_ReportServer) error + type MetricGRPC_QueryClient interface + Recv func() (*MetricResponse, error) + Send func(*MetricQueryRequest) error + type MetricGRPC_QueryServer interface + Recv func() (*MetricQueryRequest, error) + Send func(*MetricResponse) error + type MetricGRPC_ReportClient interface + Recv func() (*MetricResponse, error) + Send func(*MetricRequest) error + type MetricGRPC_ReportServer interface + Recv func() (*MetricRequest, error) + Send func(*MetricResponse) error + type MetricInitRequest struct + Dimensions []*MetricDimension + Key *MetricKey + MsgId *google_protobuf.Int64Value + Windows []*MetricInitRequest_MetricWindow + func (*MetricInitRequest) Descriptor() ([]byte, []int) + func (*MetricInitRequest) ProtoMessage() + func (m *MetricInitRequest) GetDimensions() []*MetricDimension + func (m *MetricInitRequest) GetKey() *MetricKey + func (m *MetricInitRequest) GetMsgId() *google_protobuf.Int64Value + func (m *MetricInitRequest) GetWindows() []*MetricInitRequest_MetricWindow + func (m *MetricInitRequest) Reset() + func (m *MetricInitRequest) String() string + type MetricInitRequest_MetricWindow struct + Duration int64 + Precision uint32 + func (*MetricInitRequest_MetricWindow) Descriptor() ([]byte, []int) + func (*MetricInitRequest_MetricWindow) ProtoMessage() + func (m *MetricInitRequest_MetricWindow) GetDuration() int64 + func (m *MetricInitRequest_MetricWindow) GetPrecision() uint32 + func (m *MetricInitRequest_MetricWindow) Reset() + func (m *MetricInitRequest_MetricWindow) String() string + type MetricKey struct + Labels string + Namespace string + Role MetricKey_Role + Service string + Subset string + func (*MetricKey) Descriptor() ([]byte, []int) + func (*MetricKey) ProtoMessage() + func (m *MetricKey) GetLabels() string + func (m *MetricKey) GetNamespace() string + func (m *MetricKey) GetRole() MetricKey_Role + func (m *MetricKey) GetService() string + func (m *MetricKey) GetSubset() string + func (m *MetricKey) Reset() + func (m *MetricKey) String() string + type MetricKey_Role int32 + const MetricKey_Callee + const MetricKey_Caller + func (MetricKey_Role) EnumDescriptor() ([]byte, []int) + func (x MetricKey_Role) String() string + type MetricQueryRequest struct + Dimensions []*MetricDimension + Duration int64 + Key *MetricKey + MsgId *google_protobuf.Int64Value + func (*MetricQueryRequest) Descriptor() ([]byte, []int) + func (*MetricQueryRequest) ProtoMessage() + func (m *MetricQueryRequest) GetDimensions() []*MetricDimension + func (m *MetricQueryRequest) GetDuration() int64 + func (m *MetricQueryRequest) GetKey() *MetricKey + func (m *MetricQueryRequest) GetMsgId() *google_protobuf.Int64Value + func (m *MetricQueryRequest) Reset() + func (m *MetricQueryRequest) String() string + type MetricRequest struct + Increments []*MetricRequest_MetricIncrement + Key *MetricKey + MsgId *google_protobuf.Int64Value + Timestamp *google_protobuf.Int64Value + func (*MetricRequest) Descriptor() ([]byte, []int) + func (*MetricRequest) ProtoMessage() + func (m *MetricRequest) GetIncrements() []*MetricRequest_MetricIncrement + func (m *MetricRequest) GetKey() *MetricKey + func (m *MetricRequest) GetMsgId() *google_protobuf.Int64Value + func (m *MetricRequest) GetTimestamp() *google_protobuf.Int64Value + func (m *MetricRequest) Reset() + func (m *MetricRequest) String() string + type MetricRequest_MetricIncrement struct + Duration int64 + Precision uint32 + Values []*MetricRequest_MetricIncrement_Values + func (*MetricRequest_MetricIncrement) Descriptor() ([]byte, []int) + func (*MetricRequest_MetricIncrement) ProtoMessage() + func (m *MetricRequest_MetricIncrement) GetDuration() int64 + func (m *MetricRequest_MetricIncrement) GetPrecision() uint32 + func (m *MetricRequest_MetricIncrement) GetValues() []*MetricRequest_MetricIncrement_Values + func (m *MetricRequest_MetricIncrement) Reset() + func (m *MetricRequest_MetricIncrement) String() string + type MetricRequest_MetricIncrement_Values struct + Dimension *MetricDimension + Values []int64 + func (*MetricRequest_MetricIncrement_Values) Descriptor() ([]byte, []int) + func (*MetricRequest_MetricIncrement_Values) ProtoMessage() + func (m *MetricRequest_MetricIncrement_Values) GetDimension() *MetricDimension + func (m *MetricRequest_MetricIncrement_Values) GetValues() []int64 + func (m *MetricRequest_MetricIncrement_Values) Reset() + func (m *MetricRequest_MetricIncrement_Values) String() string + type MetricResponse struct + Code *google_protobuf.UInt32Value + Info *google_protobuf.StringValue + MsgId *google_protobuf.Int64Value + Summaries []*MetricResponse_MetricSum + Timestamp *google_protobuf.Int64Value + func (*MetricResponse) Descriptor() ([]byte, []int) + func (*MetricResponse) ProtoMessage() + func (m *MetricResponse) GetCode() *google_protobuf.UInt32Value + func (m *MetricResponse) GetInfo() *google_protobuf.StringValue + func (m *MetricResponse) GetMsgId() *google_protobuf.Int64Value + func (m *MetricResponse) GetSummaries() []*MetricResponse_MetricSum + func (m *MetricResponse) GetTimestamp() *google_protobuf.Int64Value + func (m *MetricResponse) Reset() + func (m *MetricResponse) String() string + type MetricResponse_MetricSum struct + Duration int64 + Values []*MetricResponse_MetricSum_Value + func (*MetricResponse_MetricSum) Descriptor() ([]byte, []int) + func (*MetricResponse_MetricSum) ProtoMessage() + func (m *MetricResponse_MetricSum) GetDuration() int64 + func (m *MetricResponse_MetricSum) GetValues() []*MetricResponse_MetricSum_Value + func (m *MetricResponse_MetricSum) Reset() + func (m *MetricResponse_MetricSum) String() string + type MetricResponse_MetricSum_Value struct + Dimension *MetricDimension + Value int64 + func (*MetricResponse_MetricSum_Value) Descriptor() ([]byte, []int) + func (*MetricResponse_MetricSum_Value) ProtoMessage() + func (m *MetricResponse_MetricSum_Value) GetDimension() *MetricDimension + func (m *MetricResponse_MetricSum_Value) GetValue() int64 + func (m *MetricResponse_MetricSum_Value) Reset() + func (m *MetricResponse_MetricSum_Value) String() string + type MetricType int32 + const MetricType_ErrorCount + const MetricType_ErrorCountByType + const MetricType_LimitCount + const MetricType_ReqCount + const MetricType_ReqCountByDelay + func (MetricType) EnumDescriptor() ([]byte, []int) + func (x MetricType) String() string + type RateLimitGRPCClient interface + AcquireQuota func(ctx context.Context, opts ...grpc.CallOption) (RateLimitGRPC_AcquireQuotaClient, error) + InitializeQuota func(ctx context.Context, in *RateLimitRequest, opts ...grpc.CallOption) (*RateLimitResponse, error) + func NewRateLimitGRPCClient(cc *grpc.ClientConn) RateLimitGRPCClient + type RateLimitGRPCServer interface + AcquireQuota func(RateLimitGRPC_AcquireQuotaServer) error + InitializeQuota func(context.Context, *RateLimitRequest) (*RateLimitResponse, error) + type RateLimitGRPC_AcquireQuotaClient interface + Recv func() (*RateLimitResponse, error) + Send func(*RateLimitRequest) error + type RateLimitGRPC_AcquireQuotaServer interface + Recv func() (*RateLimitRequest, error) + Send func(*RateLimitResponse) error + type RateLimitRequest struct + Key *google_protobuf.StringValue + Namespace *google_protobuf.StringValue + Service *google_protobuf.StringValue + Timestamp *google_protobuf.Int64Value + Totals []*Limiter + Useds []*Limiter + func (*RateLimitRequest) Descriptor() ([]byte, []int) + func (*RateLimitRequest) ProtoMessage() + func (m *RateLimitRequest) GetKey() *google_protobuf.StringValue + func (m *RateLimitRequest) GetNamespace() *google_protobuf.StringValue + func (m *RateLimitRequest) GetService() *google_protobuf.StringValue + func (m *RateLimitRequest) GetTimestamp() *google_protobuf.Int64Value + func (m *RateLimitRequest) GetTotals() []*Limiter + func (m *RateLimitRequest) GetUseds() []*Limiter + func (m *RateLimitRequest) Reset() + func (m *RateLimitRequest) String() string + type RateLimitResponse struct + Code *google_protobuf.UInt32Value + Info *google_protobuf.StringValue + Key *google_protobuf.StringValue + SumUseds []*Limiter + Timestamp *google_protobuf.Int64Value + func (*RateLimitResponse) Descriptor() ([]byte, []int) + func (*RateLimitResponse) ProtoMessage() + func (m *RateLimitResponse) GetCode() *google_protobuf.UInt32Value + func (m *RateLimitResponse) GetInfo() *google_protobuf.StringValue + func (m *RateLimitResponse) GetKey() *google_protobuf.StringValue + func (m *RateLimitResponse) GetSumUseds() []*Limiter + func (m *RateLimitResponse) GetTimestamp() *google_protobuf.Int64Value + func (m *RateLimitResponse) Reset() + func (m *RateLimitResponse) String() string