Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoRows no result found. ErrNoRows = errors.New("repository fakesql: no rows found") // ErrConnectTimeout simulates timeout to db call. ErrConnectTimeout = errors.New("repository fakesql: context deadline exceeded") )
Functions ¶
This section is empty.
Types ¶
type DummyDB ¶
type DummyDB struct { }
DummyDB as a buggy *sql.DB.
func (*DummyDB) QueryRowCtx ¶
QueryRowCtx sql.DB impl.
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is dummy user repo. In reality, YOU SHOULD PREFER USING SQLC-GGENERATED CODE.
func NewUserRepository ¶
func NewUserRepository(db *DummyDB) *UserRepository
NewUserRepository returns user repo with dummy db.
func (*UserRepository) CreateUser ¶
CreateUser insert new user to db.
func (*UserRepository) FindUserByID ¶
FindUserByID finds user by specific ID inside db.
Click to show internal directories.
Click to hide internal directories.