Documentation ¶
Index ¶
- func All(t *testing.T, tester DatastoreTester)
- func DeletePreconditionsTest(t *testing.T, tester DatastoreTester)
- func DeleteRelationshipsTest(t *testing.T, tester DatastoreTester)
- func InvalidReadsTest(t *testing.T, tester DatastoreTester)
- func NamespaceDeleteTest(t *testing.T, tester DatastoreTester)
- func NamespaceWriteTest(t *testing.T, tester DatastoreTester)
- func RevisionFuzzingTest(t *testing.T, tester DatastoreTester)
- func SimpleTest(t *testing.T, tester DatastoreTester)
- func UsersetsTest(t *testing.T, tester DatastoreTester)
- func WatchCancelTest(t *testing.T, tester DatastoreTester)
- func WatchTest(t *testing.T, tester DatastoreTester)
- func WritePreconditionsTest(t *testing.T, tester DatastoreTester)
- type DatastoreTester
- type MockedCommonTupleQuery
- type MockedDatastore
- func (md *MockedDatastore) CheckRevision(ctx context.Context, revision datastore.Revision) error
- func (md *MockedDatastore) Close() error
- func (md *MockedDatastore) DeleteNamespace(ctx context.Context, nsName string) (datastore.Revision, error)
- func (md *MockedDatastore) DeleteRelationships(ctx context.Context, preconditions []*v1.Precondition, ...) (datastore.Revision, error)
- func (md *MockedDatastore) IsReady(ctx context.Context) (bool, error)
- func (md *MockedDatastore) ListNamespaces(ctx context.Context) ([]*v0.NamespaceDefinition, error)
- func (md *MockedDatastore) QueryTuples(filter datastore.TupleQueryResourceFilter, revision datastore.Revision) datastore.TupleQuery
- func (md *MockedDatastore) ReadNamespace(ctx context.Context, nsName string) (*v0.NamespaceDefinition, datastore.Revision, error)
- func (md *MockedDatastore) ReverseQueryTuplesFromSubject(subject *v0.ObjectAndRelation, revision datastore.Revision) datastore.ReverseTupleQuery
- func (md *MockedDatastore) ReverseQueryTuplesFromSubjectNamespace(subjectNamespace string, revision datastore.Revision) datastore.ReverseTupleQuery
- func (md *MockedDatastore) ReverseQueryTuplesFromSubjectRelation(subjectNamespace, subjectRelation string, revision datastore.Revision) datastore.ReverseTupleQuery
- func (md *MockedDatastore) Revision(ctx context.Context) (datastore.Revision, error)
- func (md *MockedDatastore) SyncRevision(ctx context.Context) (datastore.Revision, error)
- func (md *MockedDatastore) Watch(ctx context.Context, afterRevision datastore.Revision) (<-chan *datastore.RevisionChanges, <-chan error)
- func (md *MockedDatastore) WriteNamespace(ctx context.Context, newConfig *v0.NamespaceDefinition) (datastore.Revision, error)
- func (md *MockedDatastore) WriteTuples(ctx context.Context, preconditions []*v1.Precondition, ...) (datastore.Revision, error)
- type MockedReverseTupleQuery
- type MockedTupleQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶ added in v1.0.0
func All(t *testing.T, tester DatastoreTester)
All runs all generic datastore tests on a DatastoreTester.
func DeletePreconditionsTest ¶ added in v1.0.0
func DeletePreconditionsTest(t *testing.T, tester DatastoreTester)
DeletePreconditionsTest tests whether or not the requirements for checking preconditions via DeleteRelationships hold for a particular datastore.
func DeleteRelationshipsTest ¶ added in v1.0.0
func DeleteRelationshipsTest(t *testing.T, tester DatastoreTester)
DeleteRelationshipsTest tests whether or not the requirements for deleting relationships hold for a particular datastore.
func InvalidReadsTest ¶ added in v1.0.0
func InvalidReadsTest(t *testing.T, tester DatastoreTester)
InvalidReadsTest tests whether or not the requirements for reading via invalid revisions hold for a particular datastore.
func NamespaceDeleteTest ¶ added in v1.0.0
func NamespaceDeleteTest(t *testing.T, tester DatastoreTester)
NamespaceDeleteTest tests whether or not the requirements for deleting namespaces hold for a particular datastore.
func NamespaceWriteTest ¶ added in v1.0.0
func NamespaceWriteTest(t *testing.T, tester DatastoreTester)
NamespaceWriteTest tests whether or not the requirements for writing namespaces hold for a particular datastore.
func RevisionFuzzingTest ¶ added in v1.0.0
func RevisionFuzzingTest(t *testing.T, tester DatastoreTester)
RevisionFuzzingTest tests whether or not the requirements for revisions hold for a particular datastore.
func SimpleTest ¶ added in v1.0.0
func SimpleTest(t *testing.T, tester DatastoreTester)
SimpleTest tests whether or not the requirements for simple reading and writing of relationships hold for a particular datastore.
func UsersetsTest ¶ added in v1.0.0
func UsersetsTest(t *testing.T, tester DatastoreTester)
UsersetsTest tests whether or not the requirements for reading usersets hold for a particular datastore.
func WatchCancelTest ¶ added in v1.0.0
func WatchCancelTest(t *testing.T, tester DatastoreTester)
WatchCancelTest tests whether or not the requirements for cancelling watches hold for a particular datastore.
func WatchTest ¶ added in v1.0.0
func WatchTest(t *testing.T, tester DatastoreTester)
WatchTest tests whether or not the requirements for watching changes hold for a particular datastore.
func WritePreconditionsTest ¶ added in v1.0.0
func WritePreconditionsTest(t *testing.T, tester DatastoreTester)
WritePreconditionsTest tests whether or not the requirements for checking preconditions via WriteTuples hold for a particular datastore.
Types ¶
type DatastoreTester ¶
type DatastoreTester interface { // New creates a new datastore instance for a single test. New(revisionFuzzingTimedelta, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error) }
DatastoreTester provides a generic datastore suite a means of initializing a particular datastore.
type MockedCommonTupleQuery ¶ added in v1.1.0
MockedCommonTupleQuery is a mock implementation of the common tuple query.
func (*MockedCommonTupleQuery) Execute ¶ added in v1.1.0
func (mctq *MockedCommonTupleQuery) Execute(ctx context.Context) (datastore.TupleIterator, error)
func (*MockedCommonTupleQuery) Limit ¶ added in v1.1.0
func (mctq *MockedCommonTupleQuery) Limit(limit uint64) datastore.CommonTupleQuery
type MockedDatastore ¶ added in v1.1.0
MockedDatastore is a mock implementation of the datastore.
func (*MockedDatastore) CheckRevision ¶ added in v1.1.0
func (*MockedDatastore) Close ¶ added in v1.1.0
func (md *MockedDatastore) Close() error
func (*MockedDatastore) DeleteNamespace ¶ added in v1.1.0
func (*MockedDatastore) DeleteRelationships ¶ added in v1.1.0
func (md *MockedDatastore) DeleteRelationships(ctx context.Context, preconditions []*v1.Precondition, filter *v1.RelationshipFilter) (datastore.Revision, error)
func (*MockedDatastore) IsReady ¶ added in v1.1.0
func (md *MockedDatastore) IsReady(ctx context.Context) (bool, error)
func (*MockedDatastore) ListNamespaces ¶ added in v1.1.0
func (md *MockedDatastore) ListNamespaces(ctx context.Context) ([]*v0.NamespaceDefinition, error)
func (*MockedDatastore) QueryTuples ¶ added in v1.1.0
func (md *MockedDatastore) QueryTuples(filter datastore.TupleQueryResourceFilter, revision datastore.Revision) datastore.TupleQuery
func (*MockedDatastore) ReadNamespace ¶ added in v1.1.0
func (md *MockedDatastore) ReadNamespace(ctx context.Context, nsName string) (*v0.NamespaceDefinition, datastore.Revision, error)
func (*MockedDatastore) ReverseQueryTuplesFromSubject ¶ added in v1.1.0
func (md *MockedDatastore) ReverseQueryTuplesFromSubject(subject *v0.ObjectAndRelation, revision datastore.Revision) datastore.ReverseTupleQuery
func (*MockedDatastore) ReverseQueryTuplesFromSubjectNamespace ¶ added in v1.1.0
func (md *MockedDatastore) ReverseQueryTuplesFromSubjectNamespace(subjectNamespace string, revision datastore.Revision) datastore.ReverseTupleQuery
func (*MockedDatastore) ReverseQueryTuplesFromSubjectRelation ¶ added in v1.1.0
func (md *MockedDatastore) ReverseQueryTuplesFromSubjectRelation(subjectNamespace, subjectRelation string, revision datastore.Revision) datastore.ReverseTupleQuery
func (*MockedDatastore) SyncRevision ¶ added in v1.1.0
func (*MockedDatastore) Watch ¶ added in v1.1.0
func (md *MockedDatastore) Watch(ctx context.Context, afterRevision datastore.Revision) (<-chan *datastore.RevisionChanges, <-chan error)
func (*MockedDatastore) WriteNamespace ¶ added in v1.1.0
func (md *MockedDatastore) WriteNamespace(ctx context.Context, newConfig *v0.NamespaceDefinition) (datastore.Revision, error)
func (*MockedDatastore) WriteTuples ¶ added in v1.1.0
func (md *MockedDatastore) WriteTuples(ctx context.Context, preconditions []*v1.Precondition, updates []*v1.RelationshipUpdate) (datastore.Revision, error)
type MockedReverseTupleQuery ¶ added in v1.1.0
type MockedReverseTupleQuery struct {
MockedCommonTupleQuery
}
MockedReverseTupleQuery is a mock implementation of the reverse tuple query.
func (*MockedReverseTupleQuery) WithObjectRelation ¶ added in v1.1.0
func (mrtq *MockedReverseTupleQuery) WithObjectRelation(namespace string, relation string) datastore.ReverseTupleQuery
type MockedTupleQuery ¶ added in v1.1.0
type MockedTupleQuery struct {
MockedCommonTupleQuery
}
MockedTupleQuery is a mock implementation of the tuple query.
func (*MockedTupleQuery) WithSubjectFilter ¶ added in v1.1.0
func (mtq *MockedTupleQuery) WithSubjectFilter(filter *v1.SubjectFilter) datastore.TupleQuery
func (*MockedTupleQuery) WithUsersets ¶ added in v1.1.0
func (mtq *MockedTupleQuery) WithUsersets(usersets []*v0.ObjectAndRelation) datastore.TupleQuery