dbclient

package
v0.0.0-...-484d335 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltClient

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

BoltClient is the implementation of `IBoltClient`.

func (*BoltClient) OpenBoltDB

func (bc *BoltClient) OpenBoltDB()

OpenBoltDB opens a connection to BoltDB.

func (*BoltClient) QueryAccount

func (bc *BoltClient) QueryAccount(accountID string) (model.Account, error)

QueryAccount find `Account` by `id`.

func (*BoltClient) Seed

func (bc *BoltClient) Seed()

Seed stars seeding accounts.

type IBoltClient

type IBoltClient interface {
	OpenBoltDB()
	QueryAccount(accountID string) (model.Account, error)
	Seed()
}

IBoltClient is an interface that interacts with BoltDB.

type MockBoltClient

type MockBoltClient struct {
	mock.Mock
}

MockBoltClient is a mock implementation of a datastore client for testing purposes. Instead of the bolt.DB pointer, we're just putting a generic mock object from strechr/testify

func (*MockBoltClient) OpenBoltDB

func (m *MockBoltClient) OpenBoltDB()

OpenBoltDB is a mock method.

func (*MockBoltClient) QueryAccount

func (m *MockBoltClient) QueryAccount(accountID string) (model.Account, error)

QueryAccount return a mock account.

func (*MockBoltClient) Seed

func (m *MockBoltClient) Seed()

Seed is a mock method.

Jump to

Keyboard shortcuts

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