memory

package
v0.0.0-...-839bc5d Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 16 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) GetUniqueEntityIDsByEntityType

func (r *RelationshipReader) GetUniqueEntityIDsByEntityType(ctx context.Context, tenantID, typ, _ string) (array []string, err error)

GetUniqueEntityIDsByEntityType - Gets all entity IDs for a given entity type (unique)

func (*RelationshipReader) HeadSnapshot

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

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

func (*RelationshipReader) QueryRelationships

func (r *RelationshipReader) QueryRelationships(ctx 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(ctx 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(ctx context.Context, tenantID string, filter *base.TupleFilter) (token.EncodedSnapToken, error)

DeleteRelationships - Delete relationship from repository

func (*RelationshipWriter) WriteRelationships

func (r *RelationshipWriter) WriteRelationships(ctx 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(ctx context.Context, tenantID string) (string, error)

HeadVersion - Reads the latest version from the repository.

func (*SchemaReader) ReadSchema

func (r *SchemaReader) ReadSchema(ctx context.Context, tenantID, version string) (sch *base.SchemaDefinition, err error)

ReadSchema - Reads a new schema from repository

func (*SchemaReader) ReadSchemaDefinition

func (r *SchemaReader) ReadSchemaDefinition(ctx 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(ctx context.Context, definitions []repositories.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(ctx 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(ctx context.Context, id, name string) (result *base.Tenant, err error)

CreateTenant -

func (*TenantWriter) DeleteTenant

func (w *TenantWriter) DeleteTenant(ctx context.Context, tenantID string) (result *base.Tenant, err error)

DeleteTenant -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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