grate

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 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