memory

package
v0.0.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = &memdb.DBSchema{
	Tables: map[string]*memdb.TableSchema{
		"entity_config": {
			Name: "entity_config",
			Indexes: map[string]*memdb.IndexSchema{
				"id": {
					Name:   "id",
					Unique: true,
					Indexer: &memdb.CompoundIndex{
						Indexes: []memdb.Indexer{
							&memdb.StringFieldIndex{Field: "Entity"},
							&memdb.StringFieldIndex{Field: "Version"},
						},
					},
				},
				"version": {
					Name:    "version",
					Unique:  false,
					Indexer: &memdb.StringFieldIndex{Field: "Version"},
				},
			},
		},
		"relation_tuple": {
			Name: "relation_tuple",
			Indexes: map[string]*memdb.IndexSchema{
				"id": {
					Name:   "id",
					Unique: true,
					Indexer: &memdb.CompoundIndex{
						Indexes: []memdb.Indexer{
							&memdb.StringFieldIndex{Field: "Entity"},
							&memdb.StringFieldIndex{Field: "EntityID"},
							&memdb.StringFieldIndex{Field: "Relation"},
							&memdb.StringFieldIndex{Field: "SubjectEntity"},
							&memdb.StringFieldIndex{Field: "SubjectID"},
							&memdb.StringFieldIndex{Field: "SubjectRelation"},
						},
						AllowMissing: true,
					},
				},
				"entity-index": {
					Name:   "entity-index",
					Unique: false,
					Indexer: &memdb.CompoundIndex{
						Indexes: []memdb.Indexer{
							&memdb.StringFieldIndex{Field: "Entity"},
							&memdb.StringFieldIndex{Field: "EntityID"},
							&memdb.StringFieldIndex{Field: "Relation"},
						},
					},
				},
				"subject-index": {
					Name:   "subject-index",
					Unique: false,
					Indexer: &memdb.CompoundIndex{
						Indexes: []memdb.Indexer{
							&memdb.StringFieldIndex{Field: "Entity"},
							&memdb.StringFieldIndex{Field: "Relation"},
							&memdb.StringFieldIndex{Field: "SubjectEntity"},
						},
					},
				},
				"entity": {
					Name:   "entity",
					Unique: false,
					Indexer: &memdb.CompoundIndex{
						Indexes: []memdb.Indexer{
							&memdb.StringFieldIndex{Field: "Entity"},
						},
					},
				},
			},
		},
	},
}

Functions

This section is empty.

Types

type EntityConfigRepository

type EntityConfigRepository struct {
	Database *db.Memory
}

EntityConfigRepository -.

func NewEntityConfigRepository

func NewEntityConfigRepository(mm *db.Memory) *EntityConfigRepository

NewEntityConfigRepository -.

func (*EntityConfigRepository) All

All -

func (*EntityConfigRepository) Migrate

func (r *EntityConfigRepository) Migrate() (err error)

Migrate -

func (*EntityConfigRepository) Read

Read -

func (*EntityConfigRepository) Write

func (r *EntityConfigRepository) Write(ctx context.Context, configs []repositories.EntityConfig, version string) error

Write -

type RelationTupleRepository

type RelationTupleRepository struct {
	Database *db.Memory
}

RelationTupleRepository -.

func NewRelationTupleRepository

func NewRelationTupleRepository(mm *db.Memory) *RelationTupleRepository

NewRelationTupleRepository -.

func (*RelationTupleRepository) Delete

Delete -

func (*RelationTupleRepository) Migrate

func (r *RelationTupleRepository) Migrate() (err error)

Migrate -

func (*RelationTupleRepository) QueryTuples

func (r *RelationTupleRepository) QueryTuples(ctx context.Context, entity string, objectID string, relation string) (tuple.ITupleIterator, error)

QueryTuples -

func (*RelationTupleRepository) Read

Read -

func (*RelationTupleRepository) ReverseQueryTuples

func (r *RelationTupleRepository) ReverseQueryTuples(ctx context.Context, entity string, relation string, subjectEntity string, subjectIDs []string, subjectRelation string) (tuple.ITupleIterator, error)

ReverseQueryTuples -

func (*RelationTupleRepository) Write

Write -

Jump to

Keyboard shortcuts

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