Documentation ¶
Index ¶
- func Data(ei *dosa.EntityInfo, minimumFields []string) map[string]dosa.FieldValue
- type Connector
- func (c *Connector) CheckSchema(ctx context.Context, scope, namePrefix string, ed []*dosa.EntityDefinition) (int32, error)
- func (c *Connector) CheckSchemaStatus(ctx context.Context, scope, namePrefix string, version int32) (*dosa.SchemaStatus, error)
- func (c *Connector) CreateIfNotExists(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
- func (c *Connector) CreateScope(ctx context.Context, scope string) error
- func (c *Connector) DropScope(ctx context.Context, scope string) error
- func (c *Connector) MultiRead(ctx context.Context, ei *dosa.EntityInfo, values []map[string]dosa.FieldValue, ...) ([]*dosa.FieldValuesOrError, error)
- func (c *Connector) MultiRemove(ctx context.Context, ei *dosa.EntityInfo, ...) ([]error, error)
- func (c *Connector) MultiUpsert(ctx context.Context, ei *dosa.EntityInfo, values []map[string]dosa.FieldValue) ([]error, error)
- func (c *Connector) Range(ctx context.Context, ei *dosa.EntityInfo, ...) ([]map[string]dosa.FieldValue, string, error)
- func (c *Connector) Read(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue, ...) (map[string]dosa.FieldValue, error)
- func (c *Connector) Remove(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
- func (c *Connector) RemoveRange(ctx context.Context, ei *dosa.EntityInfo, ...) error
- func (c *Connector) Scan(ctx context.Context, ei *dosa.EntityInfo, minimumFields []string, token string, ...) ([]map[string]dosa.FieldValue, string, error)
- func (c *Connector) ScopeExists(ctx context.Context, scope string) (bool, error)
- func (c *Connector) Search(ctx context.Context, ei *dosa.EntityInfo, fieldPairs dosa.FieldNameValuePair, ...) ([]map[string]dosa.FieldValue, string, error)
- func (c *Connector) Shutdown() error
- func (c *Connector) TruncateScope(ctx context.Context, scope string) error
- func (c *Connector) Upsert(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
- func (c *Connector) UpsertSchema(ctx context.Context, scope, namePrefix string, ed []*dosa.EntityDefinition) (*dosa.SchemaStatus, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Data ¶
func Data(ei *dosa.EntityInfo, minimumFields []string) map[string]dosa.FieldValue
Data generates some random data. Because our test is blackbox in a different package, we have to export this
Types ¶
type Connector ¶
type Connector struct{}
Connector is a connector implementation for testing
func (*Connector) CheckSchema ¶
func (c *Connector) CheckSchema(ctx context.Context, scope, namePrefix string, ed []*dosa.EntityDefinition) (int32, error)
CheckSchema always returns a slice of int32 values that match its index
func (*Connector) CheckSchemaStatus ¶
func (c *Connector) CheckSchemaStatus(ctx context.Context, scope, namePrefix string, version int32) (*dosa.SchemaStatus, error)
CheckSchemaStatus always returns a schema status with version 1 and ACCEPTED
func (*Connector) CreateIfNotExists ¶
func (c *Connector) CreateIfNotExists(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
CreateIfNotExists always succeeds
func (*Connector) CreateScope ¶
CreateScope returns success
func (*Connector) MultiRead ¶
func (c *Connector) MultiRead(ctx context.Context, ei *dosa.EntityInfo, values []map[string]dosa.FieldValue, minimumFields []string) ([]*dosa.FieldValuesOrError, error)
MultiRead returns a set of random data for each key you specify
func (*Connector) MultiRemove ¶
func (c *Connector) MultiRemove(ctx context.Context, ei *dosa.EntityInfo, multiValues []map[string]dosa.FieldValue) ([]error, error)
MultiRemove returns a not found error for each value
func (*Connector) MultiUpsert ¶
func (c *Connector) MultiUpsert(ctx context.Context, ei *dosa.EntityInfo, values []map[string]dosa.FieldValue) ([]error, error)
MultiUpsert throws away all the data you upsert, returning a set of no errors
func (*Connector) Range ¶
func (c *Connector) Range(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition, minimumFields []string, token string, limit int) ([]map[string]dosa.FieldValue, string, error)
Range returns a random set of data, and a random continuation token
func (*Connector) Read ¶
func (c *Connector) Read(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue, minimumFields []string) (map[string]dosa.FieldValue, error)
Read always returns random data of the type specified
func (*Connector) Remove ¶
func (c *Connector) Remove(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
Remove always returns a not found error
func (*Connector) RemoveRange ¶
func (c *Connector) RemoveRange(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition) error
RemoveRange removes all entities within the range specified by the columnConditions.
func (*Connector) Scan ¶
func (c *Connector) Scan(ctx context.Context, ei *dosa.EntityInfo, minimumFields []string, token string, limit int) ([]map[string]dosa.FieldValue, string, error)
Scan also returns a random set of data, like Range and Search
func (*Connector) ScopeExists ¶
ScopeExists is not implemented yet
func (*Connector) Search ¶
func (c *Connector) Search(ctx context.Context, ei *dosa.EntityInfo, fieldPairs dosa.FieldNameValuePair, minimumFields []string, token string, limit int) ([]map[string]dosa.FieldValue, string, error)
Search also returns a random set of data, just like Range
func (*Connector) TruncateScope ¶
TruncateScope returns success
func (*Connector) Upsert ¶
func (c *Connector) Upsert(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error
Upsert throws away the data you upsert
func (*Connector) UpsertSchema ¶
func (c *Connector) UpsertSchema(ctx context.Context, scope, namePrefix string, ed []*dosa.EntityDefinition) (*dosa.SchemaStatus, error)
UpsertSchema always returns a slice of int32 values that match its index