Documentation ¶
Index ¶
- Constants
- 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
- type SchemaReader
- func (r *SchemaReader) HeadVersion(_ context.Context, tenantID string) (string, 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)
- type SchemaWriter
- type TenantReader
- type TenantWriter
- type Watch
Constants ¶
const ( RelationTuplesTable = "relation_tuples" AttributesTable = "attributes" SchemaDefinitionsTable = "schema_definitions" TenantsTable = "tenants" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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, logger logger.Interface) *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, logger logger.Interface) *DataWriter
NewDataWriter - Create a new DataWriter
func (*DataWriter) Delete ¶ added in v0.5.0
func (r *DataWriter) Delete(_ context.Context, tenantID string, tupleFilter *base.TupleFilter, attributeFilter *base.AttributeFilter) (token.EncodedSnapToken, error)
Delete - Delete relationship from repository
func (*DataWriter) Write ¶ added in v0.5.0
func (r *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, logger logger.Interface) *SchemaReader
NewSchemaReader - Creates a new SchemaReader
func (*SchemaReader) HeadVersion ¶
HeadVersion - Reads the latest version from the repository.
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
type SchemaWriter ¶
type SchemaWriter struct {
// contains filtered or unexported fields
}
SchemaWriter - Structure for Schema Writer
func NewSchemaWriter ¶
func NewSchemaWriter(database *db.Memory, logger logger.Interface) *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, logger logger.Interface) *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, logger logger.Interface) *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