Documentation
¶
Overview ¶
Package db contains db connection logic, data accessor functions and model
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConnection ¶
type DBConnection struct {
// contains filtered or unexported fields
}
DBConnection object which keeps database connection handler and provides data accessor functions
func NewDBConnection ¶
func NewDBConnection(dbPool *sql.DB, c *DBConnectionParams, logger *logr.Logger) *DBConnection
NewDBConnection creates a new database connection
func (*DBConnection) InitConnection ¶
func (d *DBConnection) InitConnection() error
InitConnection initializes a connection to the database
func (*DBConnection) IsIPBlacklisted ¶
IsIPBlacklisted checks if the provided IP address is present in the blacklisted database
func (*DBConnection) UpsertBlacklistRecord ¶
func (d *DBConnection) UpsertBlacklistRecord(ctx *context.Context, blockIP string, t time.Time) error
UpsertBlacklistRecord adds or updates a Blacklisted record in the database
Click to show internal directories.
Click to hide internal directories.