Help us shape the future of Go! Take the 2026 Go Developer Survey

grate

package
v0.7.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	CommandsPerMinute: 120,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger            log.Logger
	CommandsPerMinute int
}

func (*Config) Apply

func (c *Config) Apply(opts []ConfigOpt)

type ConfigOpt

type ConfigOpt func(config *Config)

func WithCommandsPerMinute

func WithCommandsPerMinute(commandsPerMinute int) ConfigOpt

func WithLogger

func WithLogger(logger log.Logger) ConfigOpt

type Limiter

type Limiter interface {
	Logger() log.Logger
	Close(ctx context.Context) error
	Config() Config
	Wait(ctx context.Context) error
	Unlock()
}

func NewLimiter

func NewLimiter(config *Config) Limiter

Jump to

Keyboard shortcuts

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