mockdb

package
v0.0.0-...-bea2f44 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mockdb provides mock implementations of database interfaces for testing

Package mockdb is a generated GoMock package.

Package mockdb is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDBTX

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

MockDBTX is a mock of DBTX interface.

func NewMockDBTX

func NewMockDBTX(ctrl *gomock.Controller) *MockDBTX

NewMockDBTX creates a new mock instance.

func (*MockDBTX) EXPECT

func (m *MockDBTX) EXPECT() *MockDBTXMockRecorder

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

func (*MockDBTX) Exec

func (m *MockDBTX) Exec(arg0 context.Context, arg1 string, arg2 ...any) (pgconn.CommandTag, error)

Exec mocks base method.

func (*MockDBTX) Query

func (m *MockDBTX) Query(arg0 context.Context, arg1 string, arg2 ...any) (pgx.Rows, error)

Query mocks base method.

func (*MockDBTX) QueryRow

func (m *MockDBTX) QueryRow(arg0 context.Context, arg1 string, arg2 ...any) pgx.Row

QueryRow mocks base method.

type MockDBTXMockRecorder

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

MockDBTXMockRecorder is the mock recorder for MockDBTX.

func (*MockDBTXMockRecorder) Exec

func (mr *MockDBTXMockRecorder) Exec(arg0, arg1 any, arg2 ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockDBTXMockRecorder) Query

func (mr *MockDBTXMockRecorder) Query(arg0, arg1 any, arg2 ...any) *gomock.Call

Query indicates an expected call of Query.

func (*MockDBTXMockRecorder) QueryRow

func (mr *MockDBTXMockRecorder) QueryRow(arg0, arg1 any, arg2 ...any) *gomock.Call

QueryRow indicates an expected call of QueryRow.

type MockPoolInterface

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

MockPoolInterface is a mock of PoolInterface interface.

func NewMockPoolInterface

func NewMockPoolInterface(ctrl *gomock.Controller) *MockPoolInterface

NewMockPoolInterface creates a new mock instance.

func (*MockPoolInterface) Acquire

func (m *MockPoolInterface) Acquire(ctx context.Context) (*pgxpool.Conn, error)

Acquire mocks base method.

func (*MockPoolInterface) Begin

func (m *MockPoolInterface) Begin(ctx context.Context) (pgx.Tx, error)

Begin mocks base method.

func (*MockPoolInterface) BeginTx

func (m *MockPoolInterface) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)

BeginTx mocks base method.

func (*MockPoolInterface) Close

func (m *MockPoolInterface) Close()

Close mocks base method.

func (*MockPoolInterface) Config

func (m *MockPoolInterface) Config() *pgxpool.Config

Config mocks base method.

func (*MockPoolInterface) EXPECT

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

func (*MockPoolInterface) Exec

func (m *MockPoolInterface) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)

Exec mocks base method.

func (*MockPoolInterface) Ping

func (m *MockPoolInterface) Ping(ctx context.Context) error

Ping mocks base method.

func (*MockPoolInterface) Query

func (m *MockPoolInterface) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)

Query mocks base method.

func (*MockPoolInterface) QueryRow

func (m *MockPoolInterface) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row

QueryRow mocks base method.

func (*MockPoolInterface) Stat

func (m *MockPoolInterface) Stat() *pgxpool.Stat

Stat mocks base method.

type MockPoolInterfaceMockRecorder

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

MockPoolInterfaceMockRecorder is the mock recorder for MockPoolInterface.

func (*MockPoolInterfaceMockRecorder) Acquire

func (mr *MockPoolInterfaceMockRecorder) Acquire(ctx any) *gomock.Call

Acquire indicates an expected call of Acquire.

func (*MockPoolInterfaceMockRecorder) Begin

func (mr *MockPoolInterfaceMockRecorder) Begin(ctx any) *gomock.Call

Begin indicates an expected call of Begin.

func (*MockPoolInterfaceMockRecorder) BeginTx

func (mr *MockPoolInterfaceMockRecorder) BeginTx(ctx, txOptions any) *gomock.Call

BeginTx indicates an expected call of BeginTx.

func (*MockPoolInterfaceMockRecorder) Close

Close indicates an expected call of Close.

func (*MockPoolInterfaceMockRecorder) Config

Config indicates an expected call of Config.

func (*MockPoolInterfaceMockRecorder) Exec

func (mr *MockPoolInterfaceMockRecorder) Exec(ctx, sql any, arguments ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockPoolInterfaceMockRecorder) Ping

Ping indicates an expected call of Ping.

func (*MockPoolInterfaceMockRecorder) Query

func (mr *MockPoolInterfaceMockRecorder) Query(ctx, sql any, args ...any) *gomock.Call

Query indicates an expected call of Query.

func (*MockPoolInterfaceMockRecorder) QueryRow

func (mr *MockPoolInterfaceMockRecorder) QueryRow(ctx, sql any, args ...any) *gomock.Call

QueryRow indicates an expected call of QueryRow.

func (*MockPoolInterfaceMockRecorder) Stat

Stat indicates an expected call of Stat.

type MockQuerierInterface

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

MockQuerierInterface is a mock of QuerierInterface interface.

func NewMockQuerierInterface

func NewMockQuerierInterface(ctrl *gomock.Controller) *MockQuerierInterface

NewMockQuerierInterface creates a new mock instance.

func (*MockQuerierInterface) CreateCharacter

func (m *MockQuerierInterface) CreateCharacter(ctx context.Context, userID, name string, x, y, chunkX, chunkY int32) (any, error)

CreateCharacter mocks base method.

func (*MockQuerierInterface) CreateUser

func (m *MockQuerierInterface) CreateUser(ctx context.Context, username, displayName, email, passwordHash string) (any, error)

CreateUser mocks base method.

func (*MockQuerierInterface) EXPECT

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

func (*MockQuerierInterface) GetCharacter

func (m *MockQuerierInterface) GetCharacter(ctx context.Context, id string) (any, error)

GetCharacter mocks base method.

func (*MockQuerierInterface) GetCharactersByUserID

func (m *MockQuerierInterface) GetCharactersByUserID(ctx context.Context, userID string) ([]any, error)

GetCharactersByUserID mocks base method.

func (*MockQuerierInterface) GetUserByEmail

func (m *MockQuerierInterface) GetUserByEmail(ctx context.Context, email string) (any, error)

GetUserByEmail mocks base method.

func (*MockQuerierInterface) GetUserByID

func (m *MockQuerierInterface) GetUserByID(ctx context.Context, id string) (any, error)

GetUserByID mocks base method.

func (*MockQuerierInterface) GetUserByUsername

func (m *MockQuerierInterface) GetUserByUsername(ctx context.Context, username string) (any, error)

GetUserByUsername mocks base method.

func (*MockQuerierInterface) UpdateCharacterPosition

func (m *MockQuerierInterface) UpdateCharacterPosition(ctx context.Context, id string, x, y, chunkX, chunkY int32) (any, error)

UpdateCharacterPosition mocks base method.

type MockQuerierInterfaceMockRecorder

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

MockQuerierInterfaceMockRecorder is the mock recorder for MockQuerierInterface.

func (*MockQuerierInterfaceMockRecorder) CreateCharacter

func (mr *MockQuerierInterfaceMockRecorder) CreateCharacter(ctx, userID, name, x, y, chunkX, chunkY any) *gomock.Call

CreateCharacter indicates an expected call of CreateCharacter.

func (*MockQuerierInterfaceMockRecorder) CreateUser

func (mr *MockQuerierInterfaceMockRecorder) CreateUser(ctx, username, displayName, email, passwordHash any) *gomock.Call

CreateUser indicates an expected call of CreateUser.

func (*MockQuerierInterfaceMockRecorder) GetCharacter

func (mr *MockQuerierInterfaceMockRecorder) GetCharacter(ctx, id any) *gomock.Call

GetCharacter indicates an expected call of GetCharacter.

func (*MockQuerierInterfaceMockRecorder) GetCharactersByUserID

func (mr *MockQuerierInterfaceMockRecorder) GetCharactersByUserID(ctx, userID any) *gomock.Call

GetCharactersByUserID indicates an expected call of GetCharactersByUserID.

func (*MockQuerierInterfaceMockRecorder) GetUserByEmail

func (mr *MockQuerierInterfaceMockRecorder) GetUserByEmail(ctx, email any) *gomock.Call

GetUserByEmail indicates an expected call of GetUserByEmail.

func (*MockQuerierInterfaceMockRecorder) GetUserByID

func (mr *MockQuerierInterfaceMockRecorder) GetUserByID(ctx, id any) *gomock.Call

GetUserByID indicates an expected call of GetUserByID.

func (*MockQuerierInterfaceMockRecorder) GetUserByUsername

func (mr *MockQuerierInterfaceMockRecorder) GetUserByUsername(ctx, username any) *gomock.Call

GetUserByUsername indicates an expected call of GetUserByUsername.

func (*MockQuerierInterfaceMockRecorder) UpdateCharacterPosition

func (mr *MockQuerierInterfaceMockRecorder) UpdateCharacterPosition(ctx, id, x, y, chunkX, chunkY any) *gomock.Call

UpdateCharacterPosition indicates an expected call of UpdateCharacterPosition.

type PoolInterface

type PoolInterface interface {
	Acquire(ctx context.Context) (*pgxpool.Conn, error)
	Begin(ctx context.Context) (pgx.Tx, error)
	BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
	Close()
	Config() *pgxpool.Config
	Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
	Ping(ctx context.Context) error
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
	Stat() *pgxpool.Stat
}

PoolInterface represents the pgxpool.Pool interface for mocking

type QuerierInterface

type QuerierInterface interface {
	// User operations - simplified signatures
	CreateUser(ctx context.Context, username, displayName, email, passwordHash string) (interface{}, error)
	GetUserByEmail(ctx context.Context, email string) (interface{}, error)
	GetUserByID(ctx context.Context, id string) (interface{}, error)
	GetUserByUsername(ctx context.Context, username string) (interface{}, error)

	// Character operations - simplified signatures
	CreateCharacter(ctx context.Context, userID, name string, x, y, chunkX, chunkY int32) (interface{}, error)
	GetCharacter(ctx context.Context, id string) (interface{}, error)
	GetCharactersByUserID(ctx context.Context, userID string) ([]interface{}, error)
	UpdateCharacterPosition(ctx context.Context, id string, x, y, chunkX, chunkY int32) (interface{}, error)
}

QuerierInterface represents a basic database querier interface

Jump to

Keyboard shortcuts

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