Documentation
¶
Overview ¶
Package mock provides a basic mock for testing the datastore.
Index ¶
- type Add
- type Client
- type Expect
- type Mock
- func (m *Mock) Assert(t *testing.T)
- func (m *Mock) Call(t *testing.T, args ...interface{}) []interface{}
- func (m *Mock) Expect(funcName string, args ...interface{}) *Expect
- func (m *Mock) Fatal(t *testing.T, args ...interface{})
- func (m *Mock) Fatalf(t *testing.T, format string, args ...interface{})
- type Query
- func (q *Query) After(key string, value *time.Time) client.Query
- func (q *Query) Complement(collection string, args ...interface{}) client.Query
- func (q *Query) Execute(ctx context.Context, dst interface{}) error
- func (q *Query) Field(key string, args ...interface{}) client.Query
- func (q *Query) Fields(fields ...interface{}) client.Query
- func (q *Query) Filter(filter interface{}) client.Query
- func (q *Query) First(first int) client.Query
- func (q *Query) From(collection string) client.Query
- func (q *Query) Order(by string) client.Query
- func (q *Query) Secondary() client.Query
- func (q *Query) Statement() (string, []interface{}, error)
- func (q *Query) Transform(transform func(string) string) client.Query
- type Remove
- func (r *Remove) After(key string, value *time.Time) client.Remove
- func (r *Remove) Execute(ctx context.Context) (int, error)
- func (r *Remove) Filter(filter interface{}) client.Remove
- func (r *Remove) From(collection string) client.Remove
- func (r *Remove) Order(by string) client.Remove
- func (r *Remove) Statement() (string, []interface{}, error)
- type Transaction
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Add ¶
type Add struct {
Mock
// contains filtered or unexported fields
}
Add is a mock datastore.Add
type Client ¶ added in v0.0.2
type Client struct {
Mock
// contains filtered or unexported fields
}
Client is a mock datastore.Client
func NewDisconnectedClient ¶ added in v0.0.2
NewDisconnectedClient creates a new disconnected mock store
func (*Client) Transaction ¶ added in v0.0.2
type Query ¶
type Query struct {
Mock
// contains filtered or unexported fields
}
Query is a mock datastore.Query
func NewQueryWithFail ¶
NewQueryWithFail creates a mock datastore.Query with an expected failure
func (*Query) Complement ¶ added in v0.0.22
type Remove ¶
type Remove struct {
Mock
// contains filtered or unexported fields
}
Remove is a mock datastore.Remove
type Transaction ¶
type Transaction struct {
Mock
// contains filtered or unexported fields
}
Transaction is a mock datastore.Transaction
func NewTransaction ¶
func NewTransaction(t *testing.T) *Transaction
NewTransaction creates a mock datastore.Transaction
func (*Transaction) Commit ¶
func (tx *Transaction) Commit() error
func (*Transaction) Rollback ¶
func (tx *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.