interfaces

package
v0.0.0-...-f20c94d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2016 License: MIT Imports: 2 Imported by: 2

Documentation

Index

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

func (*DbKeyRepository) Store

func (repo *DbKeyRepository) Store(key *domain.Key) error

Store 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

func (*DbUserRepository) Store

func (repo *DbUserRepository) Store(user *domain.User) error

Store Function contained on DbUserRepository

func (*DbUserRepository) Update

func (repo *DbUserRepository) Update(user *domain.User) error

Update Function contained on DbUserRepository

type Result

type Result interface {
	LastInsertId() (int64, error)
	RowsAffected() (int64, error)
}

Result interface for result processing

type Row

type Row interface {
	Scan(dest ...interface{})
	Next() bool
	Close()
}

Row interface for row processing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL