Documentation ¶
Index ¶
- type BundleReader
- type BundleWriter
- type DataReader
- func (r *DataReader) HeadSnapshot(_ context.Context, _ string) (token.SnapToken, error)
- func (r *DataReader) QueryAttributes(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string) (iterator *database.AttributeIterator, err error)
- func (r *DataReader) QueryRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string) (it *database.TupleIterator, err error)
- func (r *DataReader) QuerySingleAttribute(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string) (attribute *base.Attribute, err error)
- func (r *DataReader) QueryUniqueEntities(_ context.Context, tenantID, name, _ string, _ database.Pagination) (ids []string, ct database.EncodedContinuousToken, err error)
- func (r *DataReader) QueryUniqueSubjectReferences(_ context.Context, tenantID string, subjectReference *base.RelationReference, ...) ([]string, database.EncodedContinuousToken, error)
- func (r *DataReader) ReadAttributes(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string, ...) (collection *database.AttributeCollection, ct database.EncodedContinuousToken, ...)
- func (r *DataReader) ReadRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string, ...) (collection *database.TupleCollection, ct database.EncodedContinuousToken, ...)
- type DataWriter
- func (w *DataWriter) Delete(_ context.Context, tenantID string, tupleFilter *base.TupleFilter, ...) (token.EncodedSnapToken, error)
- func (w *DataWriter) RunBundle(ctx context.Context, tenantID string, arguments map[string]string, ...) (token.EncodedSnapToken, error)
- func (w *DataWriter) Write(_ context.Context, tenantID string, tupleCollection *database.TupleCollection, ...) (token.EncodedSnapToken, error)
- type SchemaReader
- func (r *SchemaReader) HeadVersion(_ context.Context, tenantID string) (string, error)
- func (r *SchemaReader) ListSchemas(_ context.Context, tenantID string, pagination database.Pagination) (schemas []*base.SchemaList, ct database.EncodedContinuousToken, err error)
- func (r *SchemaReader) ReadEntityDefinition(_ context.Context, tenantID, entityName, version string) (definition *base.EntityDefinition, v string, err error)
- func (r *SchemaReader) ReadRuleDefinition(_ context.Context, tenantID, ruleName, version string) (definition *base.RuleDefinition, v string, err error)
- func (r *SchemaReader) ReadSchema(_ context.Context, tenantID, version string) (sch *base.SchemaDefinition, err error)
- func (r *SchemaReader) ReadSchemaString(_ context.Context, tenantID, version string) (definitions []string, err error)
- type SchemaWriter
- type TenantReader
- type TenantWriter
- type Watch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleReader ¶ added in v0.6.0
type BundleReader struct {
// contains filtered or unexported fields
}
BundleReader -
func NewBundleReader ¶ added in v0.6.0
func NewBundleReader(database *db.Memory) *BundleReader
func (*BundleReader) Read ¶ added in v0.6.0
func (b *BundleReader) Read(ctx context.Context, tenantID, name string) (bundle *base.DataBundle, err error)
type BundleWriter ¶ added in v0.6.0
type BundleWriter struct {
// contains filtered or unexported fields
}
BundleWriter -
func NewBundleWriter ¶ added in v0.6.0
func NewBundleWriter(database *db.Memory) *BundleWriter
type DataReader ¶ added in v0.5.0
type DataReader struct {
// contains filtered or unexported fields
}
DataReader -
func NewDataReader ¶ added in v0.5.0
func NewDataReader(database *db.Memory) *DataReader
NewDataReader - Creates a new DataReader
func (*DataReader) HeadSnapshot ¶ added in v0.5.0
HeadSnapshot - Reads the latest version of the snapshot from the repository.
func (*DataReader) QueryAttributes ¶ added in v0.5.0
func (r *DataReader) QueryAttributes(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string) (iterator *database.AttributeIterator, err error)
QueryAttributes queries the database for attributes based on the provided filter.
func (*DataReader) QueryRelationships ¶ added in v0.5.0
func (r *DataReader) QueryRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string) (it *database.TupleIterator, err error)
QueryRelationships queries the database for relationships based on the provided filter.
func (*DataReader) QuerySingleAttribute ¶ added in v0.5.0
func (r *DataReader) QuerySingleAttribute(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string) (attribute *base.Attribute, err error)
QuerySingleAttribute queries the database for a single attribute based on the provided filter.
func (*DataReader) QueryUniqueEntities ¶ added in v0.5.0
func (r *DataReader) QueryUniqueEntities(_ context.Context, tenantID, name, _ string, _ database.Pagination) (ids []string, ct database.EncodedContinuousToken, err error)
QueryUniqueEntities is a function that searches for unique entities in a given database.
func (*DataReader) QueryUniqueSubjectReferences ¶ added in v0.5.0
func (r *DataReader) QueryUniqueSubjectReferences(_ context.Context, tenantID string, subjectReference *base.RelationReference, _ string, _ database.Pagination) ([]string, database.EncodedContinuousToken, error)
QueryUniqueSubjectReferences is a function that searches for unique subject references in a given database.
func (*DataReader) ReadAttributes ¶ added in v0.5.0
func (r *DataReader) ReadAttributes(_ context.Context, tenantID string, filter *base.AttributeFilter, _ string, pagination database.Pagination) (collection *database.AttributeCollection, ct database.EncodedContinuousToken, err error)
ReadAttributes reads attributes from the database taking into account the pagination.
func (*DataReader) ReadRelationships ¶ added in v0.5.0
func (r *DataReader) ReadRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string, pagination database.Pagination) (collection *database.TupleCollection, ct database.EncodedContinuousToken, err error)
ReadRelationships reads relationships from the database taking into account the pagination.
type DataWriter ¶ added in v0.5.0
type DataWriter struct {
// contains filtered or unexported fields
}
func NewDataWriter ¶ added in v0.5.0
func NewDataWriter(database *db.Memory) *DataWriter
NewDataWriter - Create a new DataWriter
func (*DataWriter) Delete ¶ added in v0.5.0
func (w *DataWriter) Delete(_ context.Context, tenantID string, tupleFilter *base.TupleFilter, attributeFilter *base.AttributeFilter) (token.EncodedSnapToken, error)
Delete - Delete relationship from repository
func (*DataWriter) RunBundle ¶ added in v0.6.0
func (w *DataWriter) RunBundle( ctx context.Context, tenantID string, arguments map[string]string, b *base.DataBundle, ) (token.EncodedSnapToken, error)
RunBundle executes a bundle of operations in the context of a given tenant. It returns an EncodedSnapToken upon successful completion or an error if the operation fails.
func (*DataWriter) Write ¶ added in v0.5.0
func (w *DataWriter) Write(_ context.Context, tenantID string, tupleCollection *database.TupleCollection, attributesCollection *database.AttributeCollection) (token.EncodedSnapToken, error)
WriteRelationships - Write a Relation to repository
type SchemaReader ¶
type SchemaReader struct {
// contains filtered or unexported fields
}
SchemaReader - Structure for Schema Reader
func NewSchemaReader ¶
func NewSchemaReader(database *db.Memory) *SchemaReader
NewSchemaReader - Creates a new SchemaReader
func (*SchemaReader) HeadVersion ¶
HeadVersion - Reads the latest version from the repository.
func (*SchemaReader) ListSchemas ¶ added in v0.7.5
func (r *SchemaReader) ListSchemas(_ context.Context, tenantID string, pagination database.Pagination) (schemas []*base.SchemaList, ct database.EncodedContinuousToken, err error)
ListSchemas - List all Schemas
func (*SchemaReader) ReadEntityDefinition ¶ added in v0.5.0
func (r *SchemaReader) ReadEntityDefinition(_ context.Context, tenantID, entityName, version string) (definition *base.EntityDefinition, v string, err error)
ReadEntityDefinition - Reads a Entity Definition from repository
func (*SchemaReader) ReadRuleDefinition ¶ added in v0.5.0
func (r *SchemaReader) ReadRuleDefinition(_ context.Context, tenantID, ruleName, version string) (definition *base.RuleDefinition, v string, err error)
ReadRuleDefinition - Reads a Rule Definition from repository
func (*SchemaReader) ReadSchema ¶
func (r *SchemaReader) ReadSchema(_ context.Context, tenantID, version string) (sch *base.SchemaDefinition, err error)
ReadSchema - Reads a new schema from repository
func (*SchemaReader) ReadSchemaString ¶ added in v0.7.9
func (r *SchemaReader) ReadSchemaString(_ context.Context, tenantID, version string) (definitions []string, err error)
ReadSchemaString returns the schema definition for a specific tenant and version as a string.
type SchemaWriter ¶
type SchemaWriter struct {
// contains filtered or unexported fields
}
SchemaWriter - Structure for Schema Writer
func NewSchemaWriter ¶
func NewSchemaWriter(database *db.Memory) *SchemaWriter
NewSchemaWriter creates a new SchemaWriter
func (*SchemaWriter) WriteSchema ¶
func (w *SchemaWriter) WriteSchema(_ context.Context, definitions []storage.SchemaDefinition) error
WriteSchema - Write Schema to repository
type TenantReader ¶
type TenantReader struct {
// contains filtered or unexported fields
}
TenantReader - Structure for Tenant Reader
func NewTenantReader ¶
func NewTenantReader(database *db.Memory) *TenantReader
NewTenantReader creates a new TenantReader
func (*TenantReader) ListTenants ¶
func (r *TenantReader) ListTenants(_ context.Context, pagination database.Pagination) (tenants []*base.Tenant, ct database.EncodedContinuousToken, err error)
ListTenants -
type TenantWriter ¶
type TenantWriter struct {
// contains filtered or unexported fields
}
TenantWriter - Structure for Tenant Writer
func NewTenantWriter ¶
func NewTenantWriter(database *db.Memory) *TenantWriter
NewTenantWriter creates a new TenantWriter
func (*TenantWriter) CreateTenant ¶
func (w *TenantWriter) CreateTenant(_ context.Context, id, name string) (result *base.Tenant, err error)
CreateTenant -
func (*TenantWriter) DeleteTenant ¶
func (w *TenantWriter) DeleteTenant(_ context.Context, tenantID string) (result *base.Tenant, err error)
DeleteTenant -
type Watch ¶ added in v0.4.4
type Watch struct {
// contains filtered or unexported fields
}
Watch - Watches for changes in the repository.
func NewWatcher ¶ added in v0.4.4
NewWatcher - Creates a new Watcher