ratelimitv1

package
v0.0.0-...-67213d2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_ratelimit_v1_service_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CommitLeaseRequest

type CommitLeaseRequest struct {
	Lease *Lease `protobuf:"bytes,1,opt,name=lease,proto3" json:"lease,omitempty"`
	// The actual cost that should be commited
	Cost int64 `protobuf:"varint,2,opt,name=cost,proto3" json:"cost,omitempty"`
	// contains filtered or unexported fields
}

func (*CommitLeaseRequest) Descriptor deprecated

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

Deprecated: Use CommitLeaseRequest.ProtoReflect.Descriptor instead.

func (*CommitLeaseRequest) GetCost

func (x *CommitLeaseRequest) GetCost() int64

func (*CommitLeaseRequest) GetLease

func (x *CommitLeaseRequest) GetLease() *Lease

func (*CommitLeaseRequest) ProtoMessage

func (*CommitLeaseRequest) ProtoMessage()

func (*CommitLeaseRequest) ProtoReflect

func (x *CommitLeaseRequest) ProtoReflect() protoreflect.Message

func (*CommitLeaseRequest) Reset

func (x *CommitLeaseRequest) Reset()

func (*CommitLeaseRequest) String

func (x *CommitLeaseRequest) String() string

type CommitLeaseResponse

type CommitLeaseResponse struct {
	// contains filtered or unexported fields
}

func (*CommitLeaseResponse) Descriptor deprecated

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

Deprecated: Use CommitLeaseResponse.ProtoReflect.Descriptor instead.

func (*CommitLeaseResponse) ProtoMessage

func (*CommitLeaseResponse) ProtoMessage()

func (*CommitLeaseResponse) ProtoReflect

func (x *CommitLeaseResponse) ProtoReflect() protoreflect.Message

func (*CommitLeaseResponse) Reset

func (x *CommitLeaseResponse) Reset()

func (*CommitLeaseResponse) String

func (x *CommitLeaseResponse) String() string

type Lease

type Lease struct {
	Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Limit      int64  `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Duration   int64  `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

Lease contains everything from original ratelimit request that we need to find the origin server

func (*Lease) Descriptor deprecated

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

Deprecated: Use Lease.ProtoReflect.Descriptor instead.

func (*Lease) GetDuration

func (x *Lease) GetDuration() int64

func (*Lease) GetIdentifier

func (x *Lease) GetIdentifier() string

func (*Lease) GetLimit

func (x *Lease) GetLimit() int64

func (*Lease) ProtoMessage

func (*Lease) ProtoMessage()

func (*Lease) ProtoReflect

func (x *Lease) ProtoReflect() protoreflect.Message

func (*Lease) Reset

func (x *Lease) Reset()

func (*Lease) String

func (x *Lease) String() string

type LeaseRequest

type LeaseRequest struct {
	Cost int64 `protobuf:"varint,1,opt,name=cost,proto3" json:"cost,omitempty"`
	// milliseconds
	Timeout int64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaseRequest) Descriptor deprecated

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

Deprecated: Use LeaseRequest.ProtoReflect.Descriptor instead.

func (*LeaseRequest) GetCost

func (x *LeaseRequest) GetCost() int64

func (*LeaseRequest) GetTimeout

func (x *LeaseRequest) GetTimeout() int64

func (*LeaseRequest) ProtoMessage

func (*LeaseRequest) ProtoMessage()

func (*LeaseRequest) ProtoReflect

func (x *LeaseRequest) ProtoReflect() protoreflect.Message

func (*LeaseRequest) Reset

func (x *LeaseRequest) Reset()

func (*LeaseRequest) String

func (x *LeaseRequest) String() string

type LivenessRequest

type LivenessRequest struct {
	// contains filtered or unexported fields
}

func (*LivenessRequest) Descriptor deprecated

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

Deprecated: Use LivenessRequest.ProtoReflect.Descriptor instead.

func (*LivenessRequest) ProtoMessage

func (*LivenessRequest) ProtoMessage()

func (*LivenessRequest) ProtoReflect

func (x *LivenessRequest) ProtoReflect() protoreflect.Message

func (*LivenessRequest) Reset

func (x *LivenessRequest) Reset()

func (*LivenessRequest) String

func (x *LivenessRequest) String() string

type LivenessResponse

type LivenessResponse struct {
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*LivenessResponse) Descriptor deprecated

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

Deprecated: Use LivenessResponse.ProtoReflect.Descriptor instead.

func (*LivenessResponse) GetStatus

func (x *LivenessResponse) GetStatus() string

func (*LivenessResponse) ProtoMessage

func (*LivenessResponse) ProtoMessage()

func (*LivenessResponse) ProtoReflect

func (x *LivenessResponse) ProtoReflect() protoreflect.Message

func (*LivenessResponse) Reset

func (x *LivenessResponse) Reset()

func (*LivenessResponse) String

func (x *LivenessResponse) String() string

type MitigateRequest

type MitigateRequest struct {
	Identifier string  `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Limit      int64   `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Duration   int64   `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
	Window     *Window `protobuf:"bytes,4,opt,name=window,proto3" json:"window,omitempty"`
	// contains filtered or unexported fields
}

func (*MitigateRequest) Descriptor deprecated

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

Deprecated: Use MitigateRequest.ProtoReflect.Descriptor instead.

func (*MitigateRequest) GetDuration

func (x *MitigateRequest) GetDuration() int64

func (*MitigateRequest) GetIdentifier

func (x *MitigateRequest) GetIdentifier() string

func (*MitigateRequest) GetLimit

func (x *MitigateRequest) GetLimit() int64

func (*MitigateRequest) GetWindow

func (x *MitigateRequest) GetWindow() *Window

func (*MitigateRequest) ProtoMessage

func (*MitigateRequest) ProtoMessage()

func (*MitigateRequest) ProtoReflect

func (x *MitigateRequest) ProtoReflect() protoreflect.Message

func (*MitigateRequest) Reset

func (x *MitigateRequest) Reset()

func (*MitigateRequest) String

func (x *MitigateRequest) String() string

type MitigateResponse

type MitigateResponse struct {
	// contains filtered or unexported fields
}

func (*MitigateResponse) Descriptor deprecated

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

Deprecated: Use MitigateResponse.ProtoReflect.Descriptor instead.

func (*MitigateResponse) ProtoMessage

func (*MitigateResponse) ProtoMessage()

func (*MitigateResponse) ProtoReflect

func (x *MitigateResponse) ProtoReflect() protoreflect.Message

func (*MitigateResponse) Reset

func (x *MitigateResponse) Reset()

func (*MitigateResponse) String

func (x *MitigateResponse) String() string

type PushPullRequest

type PushPullRequest struct {
	Request *RatelimitRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// Whether the edge note let the request pass
	// If it did, we must increment the counter on the origin regardless of the result
	Passed bool `protobuf:"varint,2,opt,name=passed,proto3" json:"passed,omitempty"`
	// The time the event happened, so we can replay it on the origin and record latency
	Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*PushPullRequest) Descriptor deprecated

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

Deprecated: Use PushPullRequest.ProtoReflect.Descriptor instead.

func (*PushPullRequest) GetPassed

func (x *PushPullRequest) GetPassed() bool

func (*PushPullRequest) GetRequest

func (x *PushPullRequest) GetRequest() *RatelimitRequest

func (*PushPullRequest) GetTime

func (x *PushPullRequest) GetTime() int64

func (*PushPullRequest) ProtoMessage

func (*PushPullRequest) ProtoMessage()

func (*PushPullRequest) ProtoReflect

func (x *PushPullRequest) ProtoReflect() protoreflect.Message

func (*PushPullRequest) Reset

func (x *PushPullRequest) Reset()

func (*PushPullRequest) String

func (x *PushPullRequest) String() string

type PushPullResponse

type PushPullResponse struct {
	Current  *Window            `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"`
	Previous *Window            `protobuf:"bytes,2,opt,name=previous,proto3" json:"previous,omitempty"`
	Response *RatelimitResponse `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*PushPullResponse) Descriptor deprecated

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

Deprecated: Use PushPullResponse.ProtoReflect.Descriptor instead.

func (*PushPullResponse) GetCurrent

func (x *PushPullResponse) GetCurrent() *Window

func (*PushPullResponse) GetPrevious

func (x *PushPullResponse) GetPrevious() *Window

func (*PushPullResponse) GetResponse

func (x *PushPullResponse) GetResponse() *RatelimitResponse

func (*PushPullResponse) ProtoMessage

func (*PushPullResponse) ProtoMessage()

func (*PushPullResponse) ProtoReflect

func (x *PushPullResponse) ProtoReflect() protoreflect.Message

func (*PushPullResponse) Reset

func (x *PushPullResponse) Reset()

func (*PushPullResponse) String

func (x *PushPullResponse) String() string

type RatelimitMultiRequest

type RatelimitMultiRequest struct {
	Ratelimits []*RatelimitRequest `protobuf:"bytes,1,rep,name=ratelimits,proto3" json:"ratelimits,omitempty"`
	// contains filtered or unexported fields
}

func (*RatelimitMultiRequest) Descriptor deprecated

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

Deprecated: Use RatelimitMultiRequest.ProtoReflect.Descriptor instead.

func (*RatelimitMultiRequest) GetRatelimits

func (x *RatelimitMultiRequest) GetRatelimits() []*RatelimitRequest

func (*RatelimitMultiRequest) ProtoMessage

func (*RatelimitMultiRequest) ProtoMessage()

func (*RatelimitMultiRequest) ProtoReflect

func (x *RatelimitMultiRequest) ProtoReflect() protoreflect.Message

func (*RatelimitMultiRequest) Reset

func (x *RatelimitMultiRequest) Reset()

func (*RatelimitMultiRequest) String

func (x *RatelimitMultiRequest) String() string

type RatelimitMultiResponse

type RatelimitMultiResponse struct {
	Ratelimits []*RatelimitResponse `protobuf:"bytes,1,rep,name=ratelimits,proto3" json:"ratelimits,omitempty"`
	// contains filtered or unexported fields
}

func (*RatelimitMultiResponse) Descriptor deprecated

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

Deprecated: Use RatelimitMultiResponse.ProtoReflect.Descriptor instead.

func (*RatelimitMultiResponse) GetRatelimits

func (x *RatelimitMultiResponse) GetRatelimits() []*RatelimitResponse

func (*RatelimitMultiResponse) ProtoMessage

func (*RatelimitMultiResponse) ProtoMessage()

func (*RatelimitMultiResponse) ProtoReflect

func (x *RatelimitMultiResponse) ProtoReflect() protoreflect.Message

func (*RatelimitMultiResponse) Reset

func (x *RatelimitMultiResponse) Reset()

func (*RatelimitMultiResponse) String

func (x *RatelimitMultiResponse) String() string

type RatelimitRequest

type RatelimitRequest struct {
	Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Limit      int64  `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Duration   int64  `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
	Cost       int64  `protobuf:"varint,4,opt,name=cost,proto3" json:"cost,omitempty"`
	// A name for the ratelimit, used for debugging
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	// Create a lease with this many tokens
	Lease *LeaseRequest `protobuf:"bytes,6,opt,name=lease,proto3,oneof" json:"lease,omitempty"`
	Time  *int64        `protobuf:"varint,7,opt,name=time,proto3,oneof" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*RatelimitRequest) Descriptor deprecated

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

Deprecated: Use RatelimitRequest.ProtoReflect.Descriptor instead.

func (*RatelimitRequest) GetCost

func (x *RatelimitRequest) GetCost() int64

func (*RatelimitRequest) GetDuration

func (x *RatelimitRequest) GetDuration() int64

func (*RatelimitRequest) GetIdentifier

func (x *RatelimitRequest) GetIdentifier() string

func (*RatelimitRequest) GetLease

func (x *RatelimitRequest) GetLease() *LeaseRequest

func (*RatelimitRequest) GetLimit

func (x *RatelimitRequest) GetLimit() int64

func (*RatelimitRequest) GetName

func (x *RatelimitRequest) GetName() string

func (*RatelimitRequest) GetTime

func (x *RatelimitRequest) GetTime() int64

func (*RatelimitRequest) ProtoMessage

func (*RatelimitRequest) ProtoMessage()

func (*RatelimitRequest) ProtoReflect

func (x *RatelimitRequest) ProtoReflect() protoreflect.Message

func (*RatelimitRequest) Reset

func (x *RatelimitRequest) Reset()

func (*RatelimitRequest) String

func (x *RatelimitRequest) String() string

type RatelimitResponse

type RatelimitResponse struct {
	Limit     int64  `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Remaining int64  `protobuf:"varint,2,opt,name=remaining,proto3" json:"remaining,omitempty"`
	Reset_    int64  `protobuf:"varint,3,opt,name=reset,proto3" json:"reset,omitempty"`
	Success   bool   `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"`
	Current   int64  `protobuf:"varint,5,opt,name=current,proto3" json:"current,omitempty"`
	Lease     *Lease `protobuf:"bytes,6,opt,name=lease,proto3,oneof" json:"lease,omitempty"`
	// contains filtered or unexported fields
}

func (*RatelimitResponse) Descriptor deprecated

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

Deprecated: Use RatelimitResponse.ProtoReflect.Descriptor instead.

func (*RatelimitResponse) GetCurrent

func (x *RatelimitResponse) GetCurrent() int64

func (*RatelimitResponse) GetLease

func (x *RatelimitResponse) GetLease() *Lease

func (*RatelimitResponse) GetLimit

func (x *RatelimitResponse) GetLimit() int64

func (*RatelimitResponse) GetRemaining

func (x *RatelimitResponse) GetRemaining() int64

func (*RatelimitResponse) GetReset_

func (x *RatelimitResponse) GetReset_() int64

func (*RatelimitResponse) GetSuccess

func (x *RatelimitResponse) GetSuccess() bool

func (*RatelimitResponse) ProtoMessage

func (*RatelimitResponse) ProtoMessage()

func (*RatelimitResponse) ProtoReflect

func (x *RatelimitResponse) ProtoReflect() protoreflect.Message

func (*RatelimitResponse) Reset

func (x *RatelimitResponse) Reset()

func (*RatelimitResponse) String

func (x *RatelimitResponse) String() string

type Window

type Window struct {
	Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
	Duration int64 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"`
	Counter  int64 `protobuf:"varint,3,opt,name=counter,proto3" json:"counter,omitempty"`
	// unix milli
	Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"`
	// An origin node can broadcast a mitigation to all nodes in the ring
	// Before the mitigation is broadcasted, the origin node must flip this to true
	// to avoid duplicate broadcasts
	MitigateBroadcasted bool `protobuf:"varint,5,opt,name=mitigate_broadcasted,json=mitigateBroadcasted,proto3" json:"mitigate_broadcasted,omitempty"`
	// A map of leaseIDs to leases
	Leases map[string]*Lease `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Window) Descriptor deprecated

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

Deprecated: Use Window.ProtoReflect.Descriptor instead.

func (*Window) GetCounter

func (x *Window) GetCounter() int64

func (*Window) GetDuration

func (x *Window) GetDuration() int64

func (*Window) GetLeases

func (x *Window) GetLeases() map[string]*Lease

func (*Window) GetMitigateBroadcasted

func (x *Window) GetMitigateBroadcasted() bool

func (*Window) GetSequence

func (x *Window) GetSequence() int64

func (*Window) GetStart

func (x *Window) GetStart() int64

func (*Window) ProtoMessage

func (*Window) ProtoMessage()

func (*Window) ProtoReflect

func (x *Window) ProtoReflect() protoreflect.Message

func (*Window) Reset

func (x *Window) Reset()

func (*Window) String

func (x *Window) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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