Documentation
¶
Overview ¶
Package storage is a generated GoMock package.
Index ¶
- func OpenSession(credentials Credentials) (db.Session, func(), error)
- func RunMigrations(dbCredentials Credentials) error
- func WithSession(credentials Credentials, actions func(session db.Session) error) error
- type Credentials
- type DBPetsRepository
- type MockPetsRepository
- type MockPetsRepositoryMockRecorder
- type PetsRepository
- type PlayerPet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenSession ¶
func OpenSession(credentials Credentials) (db.Session, func(), error)
Open db session with provided credentials.
Closing is responsibility of caller
func RunMigrations ¶
func RunMigrations(dbCredentials Credentials) error
func WithSession ¶
func WithSession(credentials Credentials, actions func(session db.Session) error) error
Run actions within a db session.
Opening and closing happens automatically around actions.
Types ¶
type Credentials ¶
type Credentials struct {
Username, Password, Host, DBName string
}
type DBPetsRepository ¶
type DBPetsRepository struct {
// contains filtered or unexported fields
}
func NewDBPetsRepository ¶
func NewDBPetsRepository(dbSession db.Session) (*DBPetsRepository, error)
func (*DBPetsRepository) FindAllPlayerPets ¶
func (impl *DBPetsRepository) FindAllPlayerPets(PlayerID string) ([]PlayerPet, error)
type MockPetsRepository ¶
type MockPetsRepository struct {
// contains filtered or unexported fields
}
MockPetsRepository is a mock of PetsRepository interface.
func NewMockPetsRepository ¶
func NewMockPetsRepository(ctrl *gomock.Controller) *MockPetsRepository
NewMockPetsRepository creates a new mock instance.
func (*MockPetsRepository) EXPECT ¶
func (m *MockPetsRepository) EXPECT() *MockPetsRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPetsRepository) FindAllPlayerPets ¶
func (m *MockPetsRepository) FindAllPlayerPets(PlayerID string) ([]PlayerPet, error)
FindAllPlayerPets mocks base method.
type MockPetsRepositoryMockRecorder ¶
type MockPetsRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockPetsRepositoryMockRecorder is the mock recorder for MockPetsRepository.
func (*MockPetsRepositoryMockRecorder) FindAllPlayerPets ¶
func (mr *MockPetsRepositoryMockRecorder) FindAllPlayerPets(PlayerID any) *gomock.Call
FindAllPlayerPets indicates an expected call of FindAllPlayerPets.
type PetsRepository ¶
Click to show internal directories.
Click to hide internal directories.