memory

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelationTuplesTable    = "relation_tuples"
	SchemaDefinitionsTable = "schema_definitions"
	TenantsTable           = "tenants"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RelationshipReader

type RelationshipReader struct {
	// contains filtered or unexported fields
}

RelationshipReader - Structure for Relationship Reader

func NewRelationshipReader

func NewRelationshipReader(database *db.Memory, logger logger.Interface) *RelationshipReader

NewRelationshipReader - Creates a new RelationshipReader

func (*RelationshipReader) HeadSnapshot

func (r *RelationshipReader) HeadSnapshot(_ context.Context, _ string) (token.SnapToken, error)

HeadSnapshot - Reads the latest version of the snapshot from the repository.

func (*RelationshipReader) QueryRelationships

func (r *RelationshipReader) QueryRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string) (it *database.TupleIterator, err error)

QueryRelationships - Reads relation tuples from the repository.

func (*RelationshipReader) ReadRelationships

func (r *RelationshipReader) ReadRelationships(_ context.Context, tenantID string, filter *base.TupleFilter, _ string, pagination database.Pagination) (collection *database.TupleCollection, ct database.EncodedContinuousToken, err error)

ReadRelationships - Gets all relationships for a given filter

type RelationshipWriter

type RelationshipWriter struct {
	// contains filtered or unexported fields
}

func NewRelationshipWriter

func NewRelationshipWriter(database *db.Memory, logger logger.Interface) *RelationshipWriter

NewRelationshipWriter - Creates a new RelationshipReader

func (*RelationshipWriter) DeleteRelationships

func (r *RelationshipWriter) DeleteRelationships(_ context.Context, tenantID string, filter *base.TupleFilter) (token.EncodedSnapToken, error)

DeleteRelationships - Delete relationship from repository

func (*RelationshipWriter) WriteRelationships

func (r *RelationshipWriter) WriteRelationships(_ context.Context, tenantID string, collection *database.TupleCollection) (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

func (r *SchemaReader) HeadVersion(_ context.Context, tenantID string) (string, error)

HeadVersion - Reads the latest version from the 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) ReadSchemaDefinition

func (r *SchemaReader) ReadSchemaDefinition(_ context.Context, tenantID, entityType, version string) (definition *base.EntityDefinition, v string, err error)

ReadSchemaDefinition - Reads a Schema Definition 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

func NewWatcher(database *db.Memory, logger logger.Interface) *Watch

NewWatcher - Creates a new Watcher

func (*Watch) Watch added in v0.4.4

func (r *Watch) Watch(_ context.Context, _, _ string) (<-chan *base.TupleChanges, <-chan error)

Watch - Watches for changes in the repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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