mock

package
v0.0.0-...-a62c2ef Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadContainer

func LoadContainer() *infra.Container

Types

type DB

type DB struct {
	app.Database
	// contains filtered or unexported fields
}

func LoadDatabase

func LoadDatabase() *DB

func (*DB) Add

func (d *DB) Add(name string, dataList ...app.DatabaseSelectResult)

func (*DB) Captures

func (d *DB) Captures() []*SQLCapture

func (*DB) ClearCapture

func (d *DB) ClearCapture()

func (*DB) ClearData

func (d *DB) ClearData()

func (*DB) Close

func (d *DB) Close()

func (*DB) MutateError

func (d *DB) MutateError(err error)

func (*DB) MutateResult

func (d *DB) MutateResult(lastInsertId int64, lastInsertIdErr error, rowsAffected int64, rowsAffectedErr error)

func (*DB) NewTransaction

func (d *DB) NewTransaction() app.DatabaseTransaction

func (*DB) Select

func (d *DB) Select(q string, a []interface{}, err error) ([]app.DatabaseSelectResult, error)

type LabelRepositoryImpl

type LabelRepositoryImpl struct {
	domain.LabelRepository
	DispenseIDFunc func() domain.LabelID
	Labels         map[domain.LabelID]*domain.Label
}

func LoadLabelRepoImpl

func LoadLabelRepoImpl(f func() domain.LabelID) *LabelRepositoryImpl

func (*LabelRepositoryImpl) DispenseID

func (r *LabelRepositoryImpl) DispenseID() domain.LabelID

func (*LabelRepositoryImpl) Find

func (r *LabelRepositoryImpl) Find(id string) *domain.Label

func (*LabelRepositoryImpl) FindByKey

func (r *LabelRepositoryImpl) FindByKey(key string, tenantID domain.TenantID) *domain.Label

func (*LabelRepositoryImpl) Save

func (r *LabelRepositoryImpl) Save(l *domain.Label)

type MutateResult

type MutateResult struct {
	app.DatabaseMutateResult
	// contains filtered or unexported fields
}

func (*MutateResult) LastInsertId

func (r *MutateResult) LastInsertId() (int64, error)

func (*MutateResult) RowsAffected

func (r *MutateResult) RowsAffected() (int64, error)

type OAuth2Google

type OAuth2Google struct {
	app.OAuth2Google
	// contains filtered or unexported fields
}

func LoadOAuth2Google

func LoadOAuth2Google() *OAuth2Google

func (*OAuth2Google) AuthCodeURL

func (o *OAuth2Google) AuthCodeURL(state string) string

func (*OAuth2Google) FillResponse

func (o *OAuth2Google) FillResponse(info app.OAuth2GoogleTokenInfo, err error)

func (*OAuth2Google) GetTokenInfo

func (o *OAuth2Google) GetTokenInfo(code string) (app.OAuth2GoogleTokenInfo, error)

type SQLCapture

type SQLCapture struct {
	Query string
	Args  []interface{}
}

type SQLCaptureStore

type SQLCaptureStore struct {
	// contains filtered or unexported fields
}

func (*SQLCaptureStore) Append

func (c *SQLCaptureStore) Append(q string, a []interface{})

func (*SQLCaptureStore) Clear

func (c *SQLCaptureStore) Clear()

func (*SQLCaptureStore) ReadAll

func (c *SQLCaptureStore) ReadAll() []*SQLCapture

type TenantRepositoryImpl

type TenantRepositoryImpl struct {
	domain.TenantRepository
	DispenseIDFunc func() domain.TenantID
	Tenants        map[domain.TenantID]*domain.Tenant
}

func LoadTenantRepoImpl

func LoadTenantRepoImpl(f func() domain.TenantID) *TenantRepositoryImpl

func (*TenantRepositoryImpl) DispenseID

func (r *TenantRepositoryImpl) DispenseID() domain.TenantID

func (*TenantRepositoryImpl) Find

func (*TenantRepositoryImpl) Save

func (r *TenantRepositoryImpl) Save(t *domain.Tenant)

type Txn

type Txn struct {
	app.DatabaseTransaction
	// contains filtered or unexported fields
}

func (*Txn) Commit

func (t *Txn) Commit()

func (*Txn) Mutate

func (t *Txn) Mutate(q string, a []interface{}, err error) (app.DatabaseMutateResult, error)

func (*Txn) Rollback

func (t *Txn) Rollback()

func (*Txn) Select

func (t *Txn) Select(q string, a []interface{}, err error) (app.DatabaseSelectResult, error)

type UserRepositoryImpl

type UserRepositoryImpl struct {
	domain.UserRepository
	DispenseIDFunc func() domain.UserID
	Users          map[domain.UserID]*domain.User
}

UserRepositoryImpl provides mock for UserRepository implementation

func LoadUserRepoImpl

func LoadUserRepoImpl(f func() domain.UserID) *UserRepositoryImpl

LoadUserRepoImpl reutrns UserRepositoryImpl struct

func (*UserRepositoryImpl) DispenseID

func (r *UserRepositoryImpl) DispenseID() domain.UserID

DispenseID is implementation for mock

func (*UserRepositoryImpl) Find

func (r *UserRepositoryImpl) Find(id string) *domain.User

Find is implementation for mock

func (*UserRepositoryImpl) FindByMail

func (r *UserRepositoryImpl) FindByMail(addr string) *domain.User

FindByMail is implementation for mock

func (*UserRepositoryImpl) FindMulti

func (r *UserRepositoryImpl) FindMulti(ids []string) []*domain.User

func (*UserRepositoryImpl) Save

func (r *UserRepositoryImpl) Save(u *domain.User)

Save is implementation for mock

Jump to

Keyboard shortcuts

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