Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
Impl limits the total number of transactions a single user may use concurrently. Implements TxLimiter.
type TxAllowAll ¶
type TxAllowAll struct{}
TxAllowAll is a TxLimiter that allows all Get requests and does no tracking. Implements Txlimiter.
func (*TxAllowAll) Get ¶
func (txa *TxAllowAll) Get(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID) bool
Get always returns true (allows all requests). Implements TxLimiter.Get
func (*TxAllowAll) Release ¶
func (txa *TxAllowAll) Release(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID)
Release is noop, because TxAllowAll does no tracking. Implements TxLimiter.Release
type TxLimiter ¶
type TxLimiter interface { Get(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID) bool Release(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID) }
TxLimiter is the transaction limiter interface.
func New ¶
New creates a new TxLimiter. slotCount: total slot count in transaction pool maxPerUser: fraction of the pool that may be taken by single user enabled: should the feature be enabled. If false, will return "allow-all" limiter dryRun: if true, does no limiting, but records stats of the decisions made byXXX: whether given field from immediate/effective caller id should be taken into account when deciding "user" identity for purposes of transaction limiting.