defaults

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

limits

This plugin enforces various limits.

Documentation

Index

Constants

View Source
const (
	Name                = "limits"
	GetMoreRatelimitKey = "limit.getmore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitsPlugin

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

This is a plugin that handles sending the request to the acutual downstream mongo

func (*LimitsPlugin) Configure

func (p *LimitsPlugin) Configure(d bson.D) error

Configure configures this plugin with the given configuration object. Returns an error if the configuration is invalid for the plugin.

func (*LimitsPlugin) Name

func (p *LimitsPlugin) Name() string

func (*LimitsPlugin) Process

func (p *LimitsPlugin) Process(ctx context.Context, r *plugins.Request, next plugins.PipelineFunc) (bson.D, error)

Process is the function executed when a message is called in the pipeline.

type LimitsPluginConfig

type LimitsPluginConfig struct {
	// BatchSizeLimit defines a limit for a query's batch size
	BatchSizeLimit int32 `bson:"batchSizeLimit"`

	// GetMoreStreamRatelimit defines a ratelimit for any given getMore stream
	GetMoreStreamRatelimit int `bson:"getMoreStreamRatelimit"`
}

Jump to

Keyboard shortcuts

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