limiter

package
v0.5.1-pp-node Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "common.rpc.limiter"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultTokens  Tokens            `yaml:"default"`
	ResponseTokens map[string]Tokens `yaml:"rpc"`
}

type ConfigGetter

type ConfigGetter interface {
	GetLimiterConf() Config
}

type RpcLimiter

type RpcLimiter interface {
	app.ComponentRunnable
	// WrapDRPCHandler wraps the given drpc.Handler with additional functionality
	WrapDRPCHandler(handler drpc.Handler) drpc.Handler
}

func New

func New() RpcLimiter

type Tokens

type Tokens struct {
	TokensPerSecond int `yaml:"rps"`
	MaxTokens       int `yaml:"burst"`
}

Directories

Path Synopsis
Package mock_limiter is a generated GoMock package.
Package mock_limiter is a generated GoMock package.

Jump to

Keyboard shortcuts

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