repositories

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

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

type SchemaDefinition struct {
	EntityType           string
	SerializedDefinition []byte
	Version              string
}

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 -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL