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 ¶
- type MockDBTX
- func (m *MockDBTX) EXPECT() *MockDBTXMockRecorder
- func (m *MockDBTX) Exec(arg0 context.Context, arg1 string, arg2 ...any) (pgconn.CommandTag, error)
- func (m *MockDBTX) Query(arg0 context.Context, arg1 string, arg2 ...any) (pgx.Rows, error)
- func (m *MockDBTX) QueryRow(arg0 context.Context, arg1 string, arg2 ...any) pgx.Row
- type MockDBTXMockRecorder
- type MockPoolInterface
- func (m *MockPoolInterface) Acquire(ctx context.Context) (*pgxpool.Conn, error)
- func (m *MockPoolInterface) Begin(ctx context.Context) (pgx.Tx, error)
- func (m *MockPoolInterface) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
- func (m *MockPoolInterface) Close()
- func (m *MockPoolInterface) Config() *pgxpool.Config
- func (m *MockPoolInterface) EXPECT() *MockPoolInterfaceMockRecorder
- func (m *MockPoolInterface) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
- func (m *MockPoolInterface) Ping(ctx context.Context) error
- func (m *MockPoolInterface) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (m *MockPoolInterface) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (m *MockPoolInterface) Stat() *pgxpool.Stat
- type MockPoolInterfaceMockRecorder
- func (mr *MockPoolInterfaceMockRecorder) Acquire(ctx any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Begin(ctx any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) BeginTx(ctx, txOptions any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Close() *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Config() *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Exec(ctx, sql any, arguments ...any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Ping(ctx any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Query(ctx, sql any, args ...any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) QueryRow(ctx, sql any, args ...any) *gomock.Call
- func (mr *MockPoolInterfaceMockRecorder) Stat() *gomock.Call
- type MockQuerierInterface
- func (m *MockQuerierInterface) CreateCharacter(ctx context.Context, userID, name string, x, y, chunkX, chunkY int32) (any, error)
- func (m *MockQuerierInterface) CreateUser(ctx context.Context, username, displayName, email, passwordHash string) (any, error)
- func (m *MockQuerierInterface) EXPECT() *MockQuerierInterfaceMockRecorder
- func (m *MockQuerierInterface) GetCharacter(ctx context.Context, id string) (any, error)
- func (m *MockQuerierInterface) GetCharactersByUserID(ctx context.Context, userID string) ([]any, error)
- func (m *MockQuerierInterface) GetUserByEmail(ctx context.Context, email string) (any, error)
- func (m *MockQuerierInterface) GetUserByID(ctx context.Context, id string) (any, error)
- func (m *MockQuerierInterface) GetUserByUsername(ctx context.Context, username string) (any, error)
- func (m *MockQuerierInterface) UpdateCharacterPosition(ctx context.Context, id string, x, y, chunkX, chunkY int32) (any, error)
- type MockQuerierInterfaceMockRecorder
- func (mr *MockQuerierInterfaceMockRecorder) CreateCharacter(ctx, userID, name, x, y, chunkX, chunkY any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) CreateUser(ctx, username, displayName, email, passwordHash any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) GetCharacter(ctx, id any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) GetCharactersByUserID(ctx, userID any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) GetUserByEmail(ctx, email any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) GetUserByID(ctx, id any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) GetUserByUsername(ctx, username any) *gomock.Call
- func (mr *MockQuerierInterfaceMockRecorder) UpdateCharacterPosition(ctx, id, x, y, chunkX, chunkY any) *gomock.Call
- type PoolInterface
- type QuerierInterface
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.
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.
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) Config ¶
func (m *MockPoolInterface) Config() *pgxpool.Config
Config mocks base method.
func (*MockPoolInterface) EXPECT ¶
func (m *MockPoolInterface) EXPECT() *MockPoolInterfaceMockRecorder
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) 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 ¶
func (mr *MockPoolInterfaceMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockPoolInterfaceMockRecorder) Config ¶
func (mr *MockPoolInterfaceMockRecorder) Config() *gomock.Call
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 ¶
func (mr *MockPoolInterfaceMockRecorder) Ping(ctx any) *gomock.Call
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 ¶
func (mr *MockPoolInterfaceMockRecorder) Stat() *gomock.Call
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 ¶
func (m *MockQuerierInterface) EXPECT() *MockQuerierInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockQuerierInterface) GetCharacter ¶
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 ¶
GetUserByEmail mocks base method.
func (*MockQuerierInterface) GetUserByID ¶
GetUserByID mocks base method.
func (*MockQuerierInterface) GetUserByUsername ¶
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