repository

package
v0.0.0-...-2e27f8b Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PsqlAntibruteforceRepository

type PsqlAntibruteforceRepository struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

PsqlAntibruteforceRepository is Repository implementation for postgres

func NewPsqlAntibruteforceRepository

func NewPsqlAntibruteforceRepository(DB *sqlx.DB, logger *zap.Logger) *PsqlAntibruteforceRepository

NewPsqlAntibruteforceRepository constructor for postgres repository

func (PsqlAntibruteforceRepository) BlacklistAdd

func (p PsqlAntibruteforceRepository) BlacklistAdd(ctx context.Context, subnet string) error

BlacklistAdd adding subnet to blacklist

func (PsqlAntibruteforceRepository) BlacklistRemove

func (p PsqlAntibruteforceRepository) BlacklistRemove(ctx context.Context, subnet string) error

BlacklistRemove removing subnet from blacklist

func (PsqlAntibruteforceRepository) FindIPInList

func (p PsqlAntibruteforceRepository) FindIPInList(ctx context.Context, ip string) (string, error)

FindIPInList finding IP in blacklist or whitelist, possible values: "blacklist", "whitelist", "" If ip find in both, returns "blacklist"

func (PsqlAntibruteforceRepository) WhitelistAdd

func (p PsqlAntibruteforceRepository) WhitelistAdd(ctx context.Context, subnet string) error

WhitelistAdd adding subnet to whitelist

func (PsqlAntibruteforceRepository) WhitelistRemove

func (p PsqlAntibruteforceRepository) WhitelistRemove(ctx context.Context, subnet string) error

WhitelistRemove removing subnet from whitelist

Jump to

Keyboard shortcuts

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