quotaservice

package
v0.0.0-...-e20e094 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package quotaservice is a generated protocol buffer package.

It is generated from these files:

protos/quota_service.proto

It has these top-level messages:

AllowRequest
AllowResponse

Index

Constants

This section is empty.

Variables

View Source
var AllowResponse_Status_name = map[int32]string{
	0: "OK",
	1: "REJECTED_TIMEOUT",
	2: "REJECTED_NO_BUCKET",
	3: "REJECTED_TOO_MANY_BUCKETS",
	4: "REJECTED_TOO_MANY_TOKENS_REQUESTED",
	5: "REJECTED_INVALID_REQUEST",
	6: "REJECTED_SERVER_ERROR",
}
View Source
var AllowResponse_Status_value = map[string]int32{
	"OK":                                 0,
	"REJECTED_TIMEOUT":                   1,
	"REJECTED_NO_BUCKET":                 2,
	"REJECTED_TOO_MANY_BUCKETS":          3,
	"REJECTED_TOO_MANY_TOKENS_REQUESTED": 4,
	"REJECTED_INVALID_REQUEST":           5,
	"REJECTED_SERVER_ERROR":              6,
}

Functions

func RegisterQuotaServiceServer

func RegisterQuotaServiceServer(s *grpc.Server, srv QuotaServiceServer)

Types

type AllowRequest

type AllowRequest struct {
	Namespace  string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
	BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName" json:"bucket_name,omitempty"`
	// *
	// Number of tokens requested. Defaults to 1, cannot be 0.
	TokensRequested int64 `protobuf:"varint,3,opt,name=tokens_requested,json=tokensRequested" json:"tokens_requested,omitempty"`
	// *
	// Max wait time, in millis. Defaults to 0, which assumes no waiting.
	MaxWaitMillisOverride int64 `protobuf:"varint,4,opt,name=max_wait_millis_override,json=maxWaitMillisOverride" json:"max_wait_millis_override,omitempty"`
	// *
	// Whether to override max wait time with the above value.
	// Defaults to false, which falls back to the bucket's configured value.
	MaxWaitTimeOverride bool `protobuf:"varint,5,opt,name=max_wait_time_override,json=maxWaitTimeOverride" json:"max_wait_time_override,omitempty"`
}

func (*AllowRequest) Descriptor

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

func (*AllowRequest) GetBucketName

func (m *AllowRequest) GetBucketName() string

func (*AllowRequest) GetMaxWaitMillisOverride

func (m *AllowRequest) GetMaxWaitMillisOverride() int64

func (*AllowRequest) GetMaxWaitTimeOverride

func (m *AllowRequest) GetMaxWaitTimeOverride() bool

func (*AllowRequest) GetNamespace

func (m *AllowRequest) GetNamespace() string

func (*AllowRequest) GetTokensRequested

func (m *AllowRequest) GetTokensRequested() int64

func (*AllowRequest) ProtoMessage

func (*AllowRequest) ProtoMessage()

func (*AllowRequest) Reset

func (m *AllowRequest) Reset()

func (*AllowRequest) String

func (m *AllowRequest) String() string

type AllowResponse

type AllowResponse struct {
	Status AllowResponse_Status `protobuf:"varint,1,opt,name=status,enum=quotaservice.AllowResponse_Status" json:"status,omitempty"`
	// *
	// Number of tokens granted, if status == OK
	TokensGranted int64 `protobuf:"varint,2,opt,name=tokens_granted,json=tokensGranted" json:"tokens_granted,omitempty"`
	// *
	// Wait for this many millis before proceeding, if status == OK. 0 if no waiting is required.
	WaitMillis int64 `protobuf:"varint,3,opt,name=wait_millis,json=waitMillis" json:"wait_millis,omitempty"`
}

func (*AllowResponse) Descriptor

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

func (*AllowResponse) GetStatus

func (m *AllowResponse) GetStatus() AllowResponse_Status

func (*AllowResponse) GetTokensGranted

func (m *AllowResponse) GetTokensGranted() int64

func (*AllowResponse) GetWaitMillis

func (m *AllowResponse) GetWaitMillis() int64

func (*AllowResponse) ProtoMessage

func (*AllowResponse) ProtoMessage()

func (*AllowResponse) Reset

func (m *AllowResponse) Reset()

func (*AllowResponse) String

func (m *AllowResponse) String() string

type AllowResponse_Status

type AllowResponse_Status int32
const (
	AllowResponse_OK                                 AllowResponse_Status = 0
	AllowResponse_REJECTED_TIMEOUT                   AllowResponse_Status = 1
	AllowResponse_REJECTED_NO_BUCKET                 AllowResponse_Status = 2
	AllowResponse_REJECTED_TOO_MANY_BUCKETS          AllowResponse_Status = 3
	AllowResponse_REJECTED_TOO_MANY_TOKENS_REQUESTED AllowResponse_Status = 4
	AllowResponse_REJECTED_INVALID_REQUEST           AllowResponse_Status = 5
	AllowResponse_REJECTED_SERVER_ERROR              AllowResponse_Status = 6
)

func (AllowResponse_Status) EnumDescriptor

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

func (AllowResponse_Status) String

func (x AllowResponse_Status) String() string

type QuotaServiceClient

type QuotaServiceClient interface {
	Allow(ctx context.Context, in *AllowRequest, opts ...grpc.CallOption) (*AllowResponse, error)
}

func NewQuotaServiceClient

func NewQuotaServiceClient(cc *grpc.ClientConn) QuotaServiceClient

type QuotaServiceServer

type QuotaServiceServer interface {
	Allow(context.Context, *AllowRequest) (*AllowResponse, error)
}

Directories

Path Synopsis
Package quotaservice_configs is a generated protocol buffer package.
Package quotaservice_configs is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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