Documentation ¶
Index ¶
- type DbHandler
- type DbKeyRepository
- type DbRepo
- type DbUserRepository
- func (repo *DbUserRepository) Count() (int, error)
- func (repo *DbUserRepository) CreateTable()
- func (repo *DbUserRepository) Delete(username string) error
- func (repo *DbUserRepository) GetUser(user string) (domain.User, error)
- func (repo *DbUserRepository) Store(user *domain.User) error
- func (repo *DbUserRepository) Update(user *domain.User) error
- type Result
- type Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbHandler ¶
type DbHandler interface { Execute(statement string, args ...interface{}) (Result, error) Query(statement string, args ...interface{}) (Row, error) }
DbHandler interface for querying
type DbKeyRepository ¶
type DbKeyRepository DbRepo
DbKeyRepository inheriting from DbRepo
func NewDbKeyRepository ¶
func NewDbKeyRepository(dbHandler DbHandler) *DbKeyRepository
NewDbKeyRepository creates a new instance
func (*DbKeyRepository) CreateTable ¶
func (repo *DbKeyRepository) CreateTable()
CreateTable function from DbKeyRepository
func (*DbKeyRepository) Delete ¶
func (repo *DbKeyRepository) Delete(id int64) error
Delete function from DbKeyRepository
func (*DbKeyRepository) GetKeys ¶
func (repo *DbKeyRepository) GetKeys() []domain.Key
GetKeys function from DbKeyRepository
func (*DbKeyRepository) GetUserKeys ¶
func (repo *DbKeyRepository) GetUserKeys(user string) []domain.Key
GetUserKeys function from DbKeyRepository
type DbRepo ¶
type DbRepo struct {
// contains filtered or unexported fields
}
DbRepo struct holding an instance of DbHandler
type DbUserRepository ¶
type DbUserRepository DbRepo
DbUserRepository struct
func NewDbUserRepository ¶
func NewDbUserRepository(dbHandler DbHandler) *DbUserRepository
NewDbUserRepository creates a new UserRepository backed up by a DB
func (*DbUserRepository) Count ¶
func (repo *DbUserRepository) Count() (int, error)
Count Function contained on DbUserRepository
func (*DbUserRepository) CreateTable ¶
func (repo *DbUserRepository) CreateTable()
CreateTable Function contained on DbUserRepository
func (*DbUserRepository) Delete ¶
func (repo *DbUserRepository) Delete(username string) error
Delete Function contained on DbUserRepository
func (*DbUserRepository) GetUser ¶
func (repo *DbUserRepository) GetUser(user string) (domain.User, error)
GetUser Function contained on DbUserRepository
Click to show internal directories.
Click to hide internal directories.