Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelationTuple ¶
type RelationTuple struct {
EntityType string
EntityID string
Relation string
SubjectType string
SubjectID string
SubjectRelation string
}
RelationTuple - Structure for Relational Tuple
func (RelationTuple) ToTuple ¶
func (r RelationTuple) ToTuple() *base.Tuple
ToTuple - Convert database relation tuple to base relation tuple
type RelationshipReader ¶
type RelationshipReader interface {
// QueryRelationships reads relation tuples from the repository.
QueryRelationships(ctx context.Context, filter *base.TupleFilter, token string) (collection database.ITupleCollection, err error)
// GetUniqueEntityIDsByEntityType reads unique entity IDs from the repository.
GetUniqueEntityIDsByEntityType(ctx context.Context, typ, token string) (ids []string, err error)
// HeadSnapshot reads the latest version of the snapshot from the repository.
HeadSnapshot(ctx context.Context) (token.SnapToken, error)
}
RelationshipReader -
type RelationshipWriter ¶
type RelationshipWriter interface {
// WriteRelationships writes relation tuples to the repository.
WriteRelationships(ctx context.Context, collection database.ITupleCollection) (token token.EncodedSnapToken, err error)
// DeleteRelationships deletes relation tuples from the repository.
DeleteRelationships(ctx context.Context, filter *base.TupleFilter) (token token.EncodedSnapToken, err error)
}
RelationshipWriter -
type SchemaDefinition ¶
SchemaDefinition - Structure for Schema Definition
func (SchemaDefinition) Serialized ¶
func (e SchemaDefinition) Serialized() string
Serialized - get schema serialized definition
type SchemaReader ¶
type SchemaReader interface {
// ReadSchema reads entity config from the repository.
ReadSchema(ctx context.Context, version string) (schema *base.IndexedSchema, err error)
// ReadSchemaDefinition reads entity config from the repository.
ReadSchemaDefinition(ctx context.Context, entityType, version string) (definition *base.EntityDefinition, v string, err error)
// HeadVersion reads the latest version of the schema from the repository.
HeadVersion(ctx context.Context) (version string, err error)
}
SchemaReader -
type SchemaWriter ¶
type SchemaWriter interface {
// WriteSchema writes schema to the repository.
WriteSchema(ctx context.Context, definitions []SchemaDefinition) (version string, err error)
}
SchemaWriter -
Click to show internal directories.
Click to hide internal directories.