database

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package database is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Database

type Database struct {
	Q  Querier
	DB *sql.DB
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(cfg *config.Config, logger *logger.Logger) *Database

func (*Database) Close

func (d *Database) Close() error

func (*Database) Init

func (d *Database) Init(ctx context.Context) error

type MockQuerier added in v1.2.0

type MockQuerier struct {
	// contains filtered or unexported fields
}

MockQuerier is a mock of Querier interface.

func NewMockQuerier added in v1.2.0

func NewMockQuerier(ctrl *gomock.Controller) *MockQuerier

NewMockQuerier creates a new mock instance.

func (*MockQuerier) EXPECT added in v1.2.0

func (m *MockQuerier) EXPECT() *MockQuerierMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockQuerier) GetAllASNExcludeList added in v1.2.0

func (m *MockQuerier) GetAllASNExcludeList(ctx context.Context, db DBTX) ([]int64, error)

GetAllASNExcludeList mocks base method.

func (*MockQuerier) GetAllASNIncludeList added in v1.2.0

func (m *MockQuerier) GetAllASNIncludeList(ctx context.Context, db DBTX) ([]int64, error)

GetAllASNIncludeList mocks base method.

func (*MockQuerier) GetAllCountryBlockList added in v1.2.0

func (m *MockQuerier) GetAllCountryBlockList(ctx context.Context, db DBTX) ([]string, error)

GetAllCountryBlockList mocks base method.

func (*MockQuerier) GetAllDomainExcludeList added in v1.2.0

func (m *MockQuerier) GetAllDomainExcludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllDomainExcludeList mocks base method.

func (*MockQuerier) GetAllDomainIncludeList added in v1.2.0

func (m *MockQuerier) GetAllDomainIncludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllDomainIncludeList mocks base method.

func (*MockQuerier) GetAllIPAllowList added in v1.2.0

func (m *MockQuerier) GetAllIPAllowList(ctx context.Context, db DBTX) ([]string, error)

GetAllIPAllowList mocks base method.

func (*MockQuerier) GetAllIPExcludeList added in v1.2.0

func (m *MockQuerier) GetAllIPExcludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllIPExcludeList mocks base method.

func (*MockQuerier) GetAllIPIncludeList added in v1.2.0

func (m *MockQuerier) GetAllIPIncludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllIPIncludeList mocks base method.

func (*MockQuerier) GetAllJA3ExcludeList added in v1.2.0

func (m *MockQuerier) GetAllJA3ExcludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllJA3ExcludeList mocks base method.

func (*MockQuerier) GetAllJA3IncludeList added in v1.2.0

func (m *MockQuerier) GetAllJA3IncludeList(ctx context.Context, db DBTX) ([]string, error)

GetAllJA3IncludeList mocks base method.

func (*MockQuerier) RemoveASNExcludeList added in v1.2.0

func (m *MockQuerier) RemoveASNExcludeList(ctx context.Context, db DBTX, asn int64) error

RemoveASNExcludeList mocks base method.

func (*MockQuerier) RemoveASNIncludeList added in v1.2.0

func (m *MockQuerier) RemoveASNIncludeList(ctx context.Context, db DBTX, asn int64) error

RemoveASNIncludeList mocks base method.

func (*MockQuerier) RemoveCountryBlockList added in v1.2.0

func (m *MockQuerier) RemoveCountryBlockList(ctx context.Context, db DBTX, country string) error

RemoveCountryBlockList mocks base method.

func (*MockQuerier) RemoveDomainExcludeList added in v1.2.0

func (m *MockQuerier) RemoveDomainExcludeList(ctx context.Context, db DBTX, domain string) error

RemoveDomainExcludeList mocks base method.

func (*MockQuerier) RemoveDomainIncludeList added in v1.2.0

func (m *MockQuerier) RemoveDomainIncludeList(ctx context.Context, db DBTX, domain string) error

RemoveDomainIncludeList mocks base method.

func (*MockQuerier) RemoveIPAllowList added in v1.2.0

func (m *MockQuerier) RemoveIPAllowList(ctx context.Context, db DBTX, subnet string) error

RemoveIPAllowList mocks base method.

func (*MockQuerier) RemoveIPExcludeList added in v1.2.0

func (m *MockQuerier) RemoveIPExcludeList(ctx context.Context, db DBTX, subnet string) error

RemoveIPExcludeList mocks base method.

func (*MockQuerier) RemoveIPIncludeList added in v1.2.0

func (m *MockQuerier) RemoveIPIncludeList(ctx context.Context, db DBTX, subnet string) error

RemoveIPIncludeList mocks base method.

func (*MockQuerier) RemoveJA3ExcludeList added in v1.2.0

func (m *MockQuerier) RemoveJA3ExcludeList(ctx context.Context, db DBTX, hash string) error

RemoveJA3ExcludeList mocks base method.

func (*MockQuerier) RemoveJA3IncludeList added in v1.2.0

func (m *MockQuerier) RemoveJA3IncludeList(ctx context.Context, db DBTX, hash string) error

RemoveJA3IncludeList mocks base method.

func (*MockQuerier) UpsertASNExcludeList added in v1.2.0

func (m *MockQuerier) UpsertASNExcludeList(ctx context.Context, db DBTX, asn int64) error

UpsertASNExcludeList mocks base method.

func (*MockQuerier) UpsertASNIncludeList added in v1.2.0

func (m *MockQuerier) UpsertASNIncludeList(ctx context.Context, db DBTX, asn int64) error

UpsertASNIncludeList mocks base method.

func (*MockQuerier) UpsertCountryBlockList added in v1.2.0

func (m *MockQuerier) UpsertCountryBlockList(ctx context.Context, db DBTX, country string) error

UpsertCountryBlockList mocks base method.

func (*MockQuerier) UpsertDomainExcludeList added in v1.2.0

func (m *MockQuerier) UpsertDomainExcludeList(ctx context.Context, db DBTX, domain string) error

UpsertDomainExcludeList mocks base method.

func (*MockQuerier) UpsertDomainIncludeList added in v1.2.0

func (m *MockQuerier) UpsertDomainIncludeList(ctx context.Context, db DBTX, domain string) error

UpsertDomainIncludeList mocks base method.

func (*MockQuerier) UpsertIPAllowList added in v1.2.0

func (m *MockQuerier) UpsertIPAllowList(ctx context.Context, db DBTX, subnet string) error

UpsertIPAllowList mocks base method.

func (*MockQuerier) UpsertIPExcludeList added in v1.2.0

func (m *MockQuerier) UpsertIPExcludeList(ctx context.Context, db DBTX, subnet string) error

UpsertIPExcludeList mocks base method.

func (*MockQuerier) UpsertIPIncludeList added in v1.2.0

func (m *MockQuerier) UpsertIPIncludeList(ctx context.Context, db DBTX, subnet string) error

UpsertIPIncludeList mocks base method.

func (*MockQuerier) UpsertJA3ExcludeList added in v1.2.0

func (m *MockQuerier) UpsertJA3ExcludeList(ctx context.Context, db DBTX, hash string) error

UpsertJA3ExcludeList mocks base method.

func (*MockQuerier) UpsertJA3IncludeList added in v1.2.0

func (m *MockQuerier) UpsertJA3IncludeList(ctx context.Context, db DBTX, hash string) error

UpsertJA3IncludeList mocks base method.

type MockQuerierMockRecorder added in v1.2.0

type MockQuerierMockRecorder struct {
	// contains filtered or unexported fields
}

MockQuerierMockRecorder is the mock recorder for MockQuerier.

func (*MockQuerierMockRecorder) GetAllASNExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllASNExcludeList(ctx, db any) *gomock.Call

GetAllASNExcludeList indicates an expected call of GetAllASNExcludeList.

func (*MockQuerierMockRecorder) GetAllASNIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllASNIncludeList(ctx, db any) *gomock.Call

GetAllASNIncludeList indicates an expected call of GetAllASNIncludeList.

func (*MockQuerierMockRecorder) GetAllCountryBlockList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllCountryBlockList(ctx, db any) *gomock.Call

GetAllCountryBlockList indicates an expected call of GetAllCountryBlockList.

func (*MockQuerierMockRecorder) GetAllDomainExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllDomainExcludeList(ctx, db any) *gomock.Call

GetAllDomainExcludeList indicates an expected call of GetAllDomainExcludeList.

func (*MockQuerierMockRecorder) GetAllDomainIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllDomainIncludeList(ctx, db any) *gomock.Call

GetAllDomainIncludeList indicates an expected call of GetAllDomainIncludeList.

func (*MockQuerierMockRecorder) GetAllIPAllowList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllIPAllowList(ctx, db any) *gomock.Call

GetAllIPAllowList indicates an expected call of GetAllIPAllowList.

func (*MockQuerierMockRecorder) GetAllIPExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllIPExcludeList(ctx, db any) *gomock.Call

GetAllIPExcludeList indicates an expected call of GetAllIPExcludeList.

func (*MockQuerierMockRecorder) GetAllIPIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllIPIncludeList(ctx, db any) *gomock.Call

GetAllIPIncludeList indicates an expected call of GetAllIPIncludeList.

func (*MockQuerierMockRecorder) GetAllJA3ExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllJA3ExcludeList(ctx, db any) *gomock.Call

GetAllJA3ExcludeList indicates an expected call of GetAllJA3ExcludeList.

func (*MockQuerierMockRecorder) GetAllJA3IncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) GetAllJA3IncludeList(ctx, db any) *gomock.Call

GetAllJA3IncludeList indicates an expected call of GetAllJA3IncludeList.

func (*MockQuerierMockRecorder) RemoveASNExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveASNExcludeList(ctx, db, asn any) *gomock.Call

RemoveASNExcludeList indicates an expected call of RemoveASNExcludeList.

func (*MockQuerierMockRecorder) RemoveASNIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveASNIncludeList(ctx, db, asn any) *gomock.Call

RemoveASNIncludeList indicates an expected call of RemoveASNIncludeList.

func (*MockQuerierMockRecorder) RemoveCountryBlockList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveCountryBlockList(ctx, db, country any) *gomock.Call

RemoveCountryBlockList indicates an expected call of RemoveCountryBlockList.

func (*MockQuerierMockRecorder) RemoveDomainExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveDomainExcludeList(ctx, db, domain any) *gomock.Call

RemoveDomainExcludeList indicates an expected call of RemoveDomainExcludeList.

func (*MockQuerierMockRecorder) RemoveDomainIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveDomainIncludeList(ctx, db, domain any) *gomock.Call

RemoveDomainIncludeList indicates an expected call of RemoveDomainIncludeList.

func (*MockQuerierMockRecorder) RemoveIPAllowList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveIPAllowList(ctx, db, subnet any) *gomock.Call

RemoveIPAllowList indicates an expected call of RemoveIPAllowList.

func (*MockQuerierMockRecorder) RemoveIPExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveIPExcludeList(ctx, db, subnet any) *gomock.Call

RemoveIPExcludeList indicates an expected call of RemoveIPExcludeList.

func (*MockQuerierMockRecorder) RemoveIPIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveIPIncludeList(ctx, db, subnet any) *gomock.Call

RemoveIPIncludeList indicates an expected call of RemoveIPIncludeList.

func (*MockQuerierMockRecorder) RemoveJA3ExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveJA3ExcludeList(ctx, db, hash any) *gomock.Call

RemoveJA3ExcludeList indicates an expected call of RemoveJA3ExcludeList.

func (*MockQuerierMockRecorder) RemoveJA3IncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) RemoveJA3IncludeList(ctx, db, hash any) *gomock.Call

RemoveJA3IncludeList indicates an expected call of RemoveJA3IncludeList.

func (*MockQuerierMockRecorder) UpsertASNExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertASNExcludeList(ctx, db, asn any) *gomock.Call

UpsertASNExcludeList indicates an expected call of UpsertASNExcludeList.

func (*MockQuerierMockRecorder) UpsertASNIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertASNIncludeList(ctx, db, asn any) *gomock.Call

UpsertASNIncludeList indicates an expected call of UpsertASNIncludeList.

func (*MockQuerierMockRecorder) UpsertCountryBlockList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertCountryBlockList(ctx, db, country any) *gomock.Call

UpsertCountryBlockList indicates an expected call of UpsertCountryBlockList.

func (*MockQuerierMockRecorder) UpsertDomainExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertDomainExcludeList(ctx, db, domain any) *gomock.Call

UpsertDomainExcludeList indicates an expected call of UpsertDomainExcludeList.

func (*MockQuerierMockRecorder) UpsertDomainIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertDomainIncludeList(ctx, db, domain any) *gomock.Call

UpsertDomainIncludeList indicates an expected call of UpsertDomainIncludeList.

func (*MockQuerierMockRecorder) UpsertIPAllowList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertIPAllowList(ctx, db, subnet any) *gomock.Call

UpsertIPAllowList indicates an expected call of UpsertIPAllowList.

func (*MockQuerierMockRecorder) UpsertIPExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertIPExcludeList(ctx, db, subnet any) *gomock.Call

UpsertIPExcludeList indicates an expected call of UpsertIPExcludeList.

func (*MockQuerierMockRecorder) UpsertIPIncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertIPIncludeList(ctx, db, subnet any) *gomock.Call

UpsertIPIncludeList indicates an expected call of UpsertIPIncludeList.

func (*MockQuerierMockRecorder) UpsertJA3ExcludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertJA3ExcludeList(ctx, db, hash any) *gomock.Call

UpsertJA3ExcludeList indicates an expected call of UpsertJA3ExcludeList.

func (*MockQuerierMockRecorder) UpsertJA3IncludeList added in v1.2.0

func (mr *MockQuerierMockRecorder) UpsertJA3IncludeList(ctx, db, hash any) *gomock.Call

UpsertJA3IncludeList indicates an expected call of UpsertJA3IncludeList.

type Querier added in v1.2.0

type Querier interface {
	GetAllASNExcludeList(ctx context.Context, db DBTX) ([]int64, error)
	GetAllASNIncludeList(ctx context.Context, db DBTX) ([]int64, error)
	GetAllCountryBlockList(ctx context.Context, db DBTX) ([]string, error)
	GetAllDomainExcludeList(ctx context.Context, db DBTX) ([]string, error)
	GetAllDomainIncludeList(ctx context.Context, db DBTX) ([]string, error)
	GetAllIPAllowList(ctx context.Context, db DBTX) ([]string, error)
	GetAllIPExcludeList(ctx context.Context, db DBTX) ([]string, error)
	GetAllIPIncludeList(ctx context.Context, db DBTX) ([]string, error)
	GetAllJA3ExcludeList(ctx context.Context, db DBTX) ([]string, error)
	GetAllJA3IncludeList(ctx context.Context, db DBTX) ([]string, error)
	RemoveASNExcludeList(ctx context.Context, db DBTX, asn int64) error
	RemoveASNIncludeList(ctx context.Context, db DBTX, asn int64) error
	RemoveCountryBlockList(ctx context.Context, db DBTX, country string) error
	RemoveDomainExcludeList(ctx context.Context, db DBTX, domain string) error
	RemoveDomainIncludeList(ctx context.Context, db DBTX, domain string) error
	RemoveIPAllowList(ctx context.Context, db DBTX, subnet string) error
	RemoveIPExcludeList(ctx context.Context, db DBTX, subnet string) error
	RemoveIPIncludeList(ctx context.Context, db DBTX, subnet string) error
	RemoveJA3ExcludeList(ctx context.Context, db DBTX, hash string) error
	RemoveJA3IncludeList(ctx context.Context, db DBTX, hash string) error
	UpsertASNExcludeList(ctx context.Context, db DBTX, asn int64) error
	UpsertASNIncludeList(ctx context.Context, db DBTX, asn int64) error
	UpsertCountryBlockList(ctx context.Context, db DBTX, country string) error
	UpsertDomainExcludeList(ctx context.Context, db DBTX, domain string) error
	UpsertDomainIncludeList(ctx context.Context, db DBTX, domain string) error
	UpsertIPAllowList(ctx context.Context, db DBTX, subnet string) error
	UpsertIPExcludeList(ctx context.Context, db DBTX, subnet string) error
	UpsertIPIncludeList(ctx context.Context, db DBTX, subnet string) error
	UpsertJA3ExcludeList(ctx context.Context, db DBTX, hash string) error
	UpsertJA3IncludeList(ctx context.Context, db DBTX, hash string) error
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) GetAllASNExcludeList added in v1.2.0

func (q *Queries) GetAllASNExcludeList(ctx context.Context, db DBTX) ([]int64, error)

func (*Queries) GetAllASNIncludeList added in v1.2.0

func (q *Queries) GetAllASNIncludeList(ctx context.Context, db DBTX) ([]int64, error)

func (*Queries) GetAllCountryBlockList added in v1.2.0

func (q *Queries) GetAllCountryBlockList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllDomainExcludeList added in v1.2.0

func (q *Queries) GetAllDomainExcludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllDomainIncludeList added in v1.2.0

func (q *Queries) GetAllDomainIncludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllIPAllowList added in v1.2.0

func (q *Queries) GetAllIPAllowList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllIPExcludeList added in v1.2.0

func (q *Queries) GetAllIPExcludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllIPIncludeList added in v1.2.0

func (q *Queries) GetAllIPIncludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllJA3ExcludeList added in v1.2.0

func (q *Queries) GetAllJA3ExcludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) GetAllJA3IncludeList added in v1.2.0

func (q *Queries) GetAllJA3IncludeList(ctx context.Context, db DBTX) ([]string, error)

func (*Queries) RemoveASNExcludeList added in v1.2.0

func (q *Queries) RemoveASNExcludeList(ctx context.Context, db DBTX, asn int64) error

func (*Queries) RemoveASNIncludeList added in v1.2.0

func (q *Queries) RemoveASNIncludeList(ctx context.Context, db DBTX, asn int64) error

func (*Queries) RemoveCountryBlockList added in v1.2.0

func (q *Queries) RemoveCountryBlockList(ctx context.Context, db DBTX, country string) error

func (*Queries) RemoveDomainExcludeList added in v1.2.0

func (q *Queries) RemoveDomainExcludeList(ctx context.Context, db DBTX, domain string) error

func (*Queries) RemoveDomainIncludeList added in v1.2.0

func (q *Queries) RemoveDomainIncludeList(ctx context.Context, db DBTX, domain string) error

func (*Queries) RemoveIPAllowList added in v1.2.0

func (q *Queries) RemoveIPAllowList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) RemoveIPExcludeList added in v1.2.0

func (q *Queries) RemoveIPExcludeList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) RemoveIPIncludeList added in v1.2.0

func (q *Queries) RemoveIPIncludeList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) RemoveJA3ExcludeList added in v1.2.0

func (q *Queries) RemoveJA3ExcludeList(ctx context.Context, db DBTX, hash string) error

func (*Queries) RemoveJA3IncludeList added in v1.2.0

func (q *Queries) RemoveJA3IncludeList(ctx context.Context, db DBTX, hash string) error

func (*Queries) UpsertASNExcludeList added in v1.2.0

func (q *Queries) UpsertASNExcludeList(ctx context.Context, db DBTX, asn int64) error

func (*Queries) UpsertASNIncludeList added in v1.2.0

func (q *Queries) UpsertASNIncludeList(ctx context.Context, db DBTX, asn int64) error

func (*Queries) UpsertCountryBlockList added in v1.2.0

func (q *Queries) UpsertCountryBlockList(ctx context.Context, db DBTX, country string) error

func (*Queries) UpsertDomainExcludeList added in v1.2.0

func (q *Queries) UpsertDomainExcludeList(ctx context.Context, db DBTX, domain string) error

func (*Queries) UpsertDomainIncludeList added in v1.2.0

func (q *Queries) UpsertDomainIncludeList(ctx context.Context, db DBTX, domain string) error

func (*Queries) UpsertIPAllowList added in v1.2.0

func (q *Queries) UpsertIPAllowList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) UpsertIPExcludeList added in v1.2.0

func (q *Queries) UpsertIPExcludeList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) UpsertIPIncludeList added in v1.2.0

func (q *Queries) UpsertIPIncludeList(ctx context.Context, db DBTX, subnet string) error

func (*Queries) UpsertJA3ExcludeList added in v1.2.0

func (q *Queries) UpsertJA3ExcludeList(ctx context.Context, db DBTX, hash string) error

func (*Queries) UpsertJA3IncludeList added in v1.2.0

func (q *Queries) UpsertJA3IncludeList(ctx context.Context, db DBTX, hash string) error

Jump to

Keyboard shortcuts

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