ratelimit

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt added in v0.7.0

type Opt interface {
	// contains filtered or unexported methods
}

func S3Method added in v0.7.0

func S3Method(m s3.Method) Opt

func SwiftMethod added in v0.7.0

func SwiftMethod(m swift.Method) Opt

type RPM

type RPM interface {
	// StorReq acquires storage api request rate limit based on RPM config.
	StorReq(ctx context.Context, storage string, opts ...Opt) error
	// StorReqN acquires n storage api requests rate limit based on RPM config.
	StorReqN(ctx context.Context, storage string, n int, opts ...Opt) error
}

RPM storage rate limit based on requests per minute

type RateLimit added in v0.7.0

type RateLimit struct {
	Enabled            bool `yaml:"enabled"`
	IncludeMetadataAPI bool `yaml:"includeMetadataAPI"`
	RPM                int  `yaml:"rpm"`
}

type Svc

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

func New

func New(rc redis.UniversalClient, conf map[string]RateLimit) *Svc

func (*Svc) StorReq

func (s *Svc) StorReq(ctx context.Context, storage string, options ...Opt) error

func (*Svc) StorReqN

func (s *Svc) StorReqN(ctx context.Context, storage string, n int, options ...Opt) error

Jump to

Keyboard shortcuts

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