Documentation
¶
Index ¶
- type BoltConfigStorage
- func (b *BoltConfigStorage) AddToBlackList(ctx context.Context, n *net.IPNet) error
- func (b *BoltConfigStorage) AddToWhiteList(ctx context.Context, n *net.IPNet) error
- func (b *BoltConfigStorage) CheckIP(ctx context.Context, ip net.IP) (bool, error)
- func (b *BoltConfigStorage) Close(ctx context.Context) error
- func (b *BoltConfigStorage) DeleteFromBlackList(ctx context.Context, n *net.IPNet) error
- func (b *BoltConfigStorage) DeleteFromWhiteList(ctx context.Context, n *net.IPNet) error
- type MapBucketStorage
- func (m MapBucketStorage) Close(ctx context.Context)
- func (m MapBucketStorage) DeleteBucket(ctx context.Context, id string) error
- func (m MapBucketStorage) GetBucket(ctx context.Context, id string) (interfaces.Bucket, error)
- func (m MapBucketStorage) SaveBucket(ctx context.Context, id string, rateLimit uint64, bucket interfaces.Bucket) error
- type MapConfigStorage
- func (m MapConfigStorage) AddToBlackList(ctx context.Context, n *net.IPNet) error
- func (m MapConfigStorage) AddToWhiteList(ctx context.Context, n *net.IPNet) error
- func (m MapConfigStorage) CheckIP(ctx context.Context, ip net.IP) (bool, error)
- func (m MapConfigStorage) Close(ctx context.Context) error
- func (m MapConfigStorage) DeleteFromBlackList(ctx context.Context, n *net.IPNet) error
- func (m MapConfigStorage) DeleteFromWhiteList(ctx context.Context, n *net.IPNet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltConfigStorage ¶
type BoltConfigStorage struct {
// contains filtered or unexported fields
}
BoltConfigStorage bolt DB storage for config
func NewBoltConfigStorage ¶
func NewBoltConfigStorage(timeout time.Duration, fileName string) (*BoltConfigStorage, error)
NewBoltConfigStorage bolt DB config storage constructor
func (*BoltConfigStorage) AddToBlackList ¶
AddToBlackList Method to add IP network to Blacklist
func (*BoltConfigStorage) AddToWhiteList ¶
AddToWhiteList Method to add IP network to Whitelist
func (*BoltConfigStorage) Close ¶
func (b *BoltConfigStorage) Close(ctx context.Context) error
Close Method to close connection to bolt DB
func (*BoltConfigStorage) DeleteFromBlackList ¶
DeleteFromBlackList Method to delete IP network from Blacklist
func (*BoltConfigStorage) DeleteFromWhiteList ¶
DeleteFromWhiteList Method to delete IP network from Whitelist
type MapBucketStorage ¶
type MapBucketStorage struct { Buckets map[string]interfaces.Bucket // contains filtered or unexported fields }
MapBucketStorage Map bucket storage struct
func NewMapBucketStorage ¶
func NewMapBucketStorage() *MapBucketStorage
NewMapBucketStorage Map bucket storage constructor
func (MapBucketStorage) Close ¶
func (m MapBucketStorage) Close(ctx context.Context)
Close Method to close connection to storage (to implement Bucket storage interface)
func (MapBucketStorage) DeleteBucket ¶
func (m MapBucketStorage) DeleteBucket(ctx context.Context, id string) error
DeleteBucket Method to delete bucket from storage
func (MapBucketStorage) GetBucket ¶
func (m MapBucketStorage) GetBucket(ctx context.Context, id string) (interfaces.Bucket, error)
GetBucket Method to get bucket from storage
func (MapBucketStorage) SaveBucket ¶
func (m MapBucketStorage) SaveBucket(ctx context.Context, id string, rateLimit uint64, bucket interfaces.Bucket) error
SaveBucket Method to save bucket into storage
type MapConfigStorage ¶
type MapConfigStorage struct { Whitelist *models.NetList Blacklist *models.NetList // contains filtered or unexported fields }
MapConfigStorage Map config storage struct
func NewMapConfigStorage ¶
func NewMapConfigStorage() (*MapConfigStorage, error)
NewMapConfigStorage Map config storage constructor
func (MapConfigStorage) AddToBlackList ¶
AddToBlackList Method to add IP network to Blacklist
func (MapConfigStorage) AddToWhiteList ¶
AddToWhiteList Method to add IP network to Whitelist
func (MapConfigStorage) Close ¶
func (m MapConfigStorage) Close(ctx context.Context) error
Close Method to close connection to Map config storage (to implement ConfigStorage interface)
func (MapConfigStorage) DeleteFromBlackList ¶
DeleteFromBlackList Method to delete IP network from Blacklist
func (MapConfigStorage) DeleteFromWhiteList ¶
DeleteFromWhiteList Method to delete IP network from Whitelist