interfaces

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	CheckLimit(ctx context.Context) bool
	ResetLimit(ctx context.Context)
	Inactive(ctx context.Context) <-chan struct{}
}

Bucket interface

type BucketStorage

type BucketStorage interface {
	SaveBucket(ctx context.Context, id string, rateLimit uint64, bucket Bucket) error
	DeleteBucket(ctx context.Context, id string) error
	GetBucket(ctx context.Context, id string) (Bucket, error)
	Close(ctx context.Context)
}

BucketStorage Bucket storage interface

type ConfigStorage

type ConfigStorage interface {
	AddToBlackList(ctx context.Context, net *net.IPNet) error
	DeleteFromBlackList(ctx context.Context, net *net.IPNet) error
	AddToWhiteList(ctx context.Context, net *net.IPNet) error
	DeleteFromWhiteList(ctx context.Context, net *net.IPNet) error
	CheckIP(ctx context.Context, ip net.IP) (bool, error)
	Close(ctx context.Context) error
}

ConfigStorage Config storage interface

Jump to

Keyboard shortcuts

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