Documentation
¶
Index ¶
- Constants
- func NewPostgresRepository(ctx *context.Context) (repository repository.PostgresRepository, err error)
- type PostgresRepositoryImpl
- func (repository *PostgresRepositoryImpl) BeginTransaction(ctx *context.Context) (dbTx *sql.Tx, err error)
- func (repository *PostgresRepositoryImpl) CommitTransaction(dbTx *sql.Tx) (err error)
- func (repository *PostgresRepositoryImpl) CreateUser(ctx *context.Context, user *entities.User) (err error)
- func (repository *PostgresRepositoryImpl) DeleteUserByID(ctx *context.Context, userID string) (err error)
- func (repository *PostgresRepositoryImpl) GetUserByID(ctx *context.Context, userID string) (user *entities.User, err error)
- func (repository *PostgresRepositoryImpl) Init(ctx *context.Context) (err error)
- func (repository *PostgresRepositoryImpl) RollbackTransaction(dbTx *sql.Tx) (err error)
- func (repository *PostgresRepositoryImpl) UpdateUser(ctx *context.Context, user *entities.User) (err error)
Constants ¶
View Source
const (
CreateUserQuery = `INSERT INTO users (ID, email) VALUES($1, $2)`
)
User repository interface implementation
View Source
const (
GetUserByIDQuery = "SELECT email FROM user where ID = $1"
)
Variables ¶
This section is empty.
Functions ¶
func NewPostgresRepository ¶
func NewPostgresRepository(ctx *context.Context) (repository repository.PostgresRepository, err error)
Types ¶
type PostgresRepositoryImpl ¶
type PostgresRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*PostgresRepositoryImpl) BeginTransaction ¶
func (*PostgresRepositoryImpl) CommitTransaction ¶
func (repository *PostgresRepositoryImpl) CommitTransaction(dbTx *sql.Tx) (err error)
func (*PostgresRepositoryImpl) CreateUser ¶
func (*PostgresRepositoryImpl) DeleteUserByID ¶
func (repository *PostgresRepositoryImpl) DeleteUserByID(ctx *context.Context, userID string) (err error)
func (*PostgresRepositoryImpl) GetUserByID ¶
func (*PostgresRepositoryImpl) Init ¶
func (repository *PostgresRepositoryImpl) Init(ctx *context.Context) (err error)
func (*PostgresRepositoryImpl) RollbackTransaction ¶
func (repository *PostgresRepositoryImpl) RollbackTransaction(dbTx *sql.Tx) (err error)
func (*PostgresRepositoryImpl) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.