postgres

package
v0.0.0-...-144d91b Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PsqlRepository

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

func NewPsqlRepository

func NewPsqlRepository(DB *sqlx.DB, logger *zap.Logger) *PsqlRepository

func (PsqlRepository) AddToBlacklist

func (p PsqlRepository) AddToBlacklist(ctx context.Context, subnet string) error

func (PsqlRepository) AddToWhitelist

func (p PsqlRepository) AddToWhitelist(ctx context.Context, subnet string) error

func (PsqlRepository) FindIP

func (p PsqlRepository) FindIP(ctx context.Context, ip string) (string, error)

func (PsqlRepository) RemoveFromBlacklist

func (p PsqlRepository) RemoveFromBlacklist(ctx context.Context, subnet string) error

func (PsqlRepository) RemoveFromWhitelist

func (p PsqlRepository) RemoveFromWhitelist(ctx context.Context, subnet string) error

type Repository

type Repository interface {
	AddToBlacklist(ctx context.Context, subnet string) error
	RemoveFromBlacklist(ctx context.Context, subnet string) error
	AddToWhitelist(ctx context.Context, subnet string) error
	RemoveFromWhitelist(ctx context.Context, subnet string) error
	FindIP(ctx context.Context, ip string) (string, error)
}

Repository interface contain methods to work with storage

Jump to

Keyboard shortcuts

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