Documentation ¶
Index ¶
- Constants
- type RelationshipReader
- func (r *RelationshipReader) GetUniqueEntityIDsByEntityType(ctx context.Context, typ, t string) (ids []string, err error)
- func (r *RelationshipReader) HeadSnapshot(ctx context.Context) (token.SnapToken, error)
- func (r *RelationshipReader) QueryRelationships(ctx context.Context, filter *base.TupleFilter, t string) (tuples database.ITupleCollection, err error)
- type RelationshipWriter
- type SchemaReader
- func (r *SchemaReader) HeadVersion(ctx context.Context) (version string, err error)
- func (r *SchemaReader) ReadSchema(ctx context.Context, version string) (schema *base.IndexedSchema, err error)
- func (r *SchemaReader) ReadSchemaDefinition(ctx context.Context, entityType, version string) (definition *base.EntityDefinition, v string, err error)
- type SchemaWriter
Constants ¶
const ( RelationTuplesTable = "relation_tuples" SchemaDefinitionTable = "schema_definitions" TransactionsTable = "transactions" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelationshipReader ¶
type RelationshipReader struct {
// contains filtered or unexported fields
}
func NewRelationshipReader ¶
func NewRelationshipReader(database *db.Postgres, logger logger.Interface) *RelationshipReader
NewRelationshipReader - Creates a new RelationshipReader
func (*RelationshipReader) GetUniqueEntityIDsByEntityType ¶
func (r *RelationshipReader) GetUniqueEntityIDsByEntityType(ctx context.Context, typ, t string) (ids []string, err error)
GetUniqueEntityIDsByEntityType - Gets all unique entity ids for a given entity type
func (*RelationshipReader) HeadSnapshot ¶
HeadSnapshot - Gets the latest token
func (*RelationshipReader) QueryRelationships ¶
func (r *RelationshipReader) QueryRelationships(ctx context.Context, filter *base.TupleFilter, t string) (tuples database.ITupleCollection, err error)
QueryRelationships - Gets all relationships for a given filter
type RelationshipWriter ¶
type RelationshipWriter struct {
// contains filtered or unexported fields
}
RelationshipWriter - Structure for Relationship Writer
func NewRelationshipWriter ¶
func NewRelationshipWriter(database *db.Postgres, logger logger.Interface) *RelationshipWriter
NewRelationshipWriter - Creates a new RelationTupleReader
func (*RelationshipWriter) DeleteRelationships ¶
func (w *RelationshipWriter) DeleteRelationships(ctx context.Context, filter *base.TupleFilter) (token token.EncodedSnapToken, err error)
DeleteRelationships - Deletes a collection of relationships to the database
func (*RelationshipWriter) WriteRelationships ¶
func (w *RelationshipWriter) WriteRelationships(ctx context.Context, collection database.ITupleCollection) (token token.EncodedSnapToken, err error)
WriteRelationships - Writes a collection of relationships to the database
type SchemaReader ¶
type SchemaReader struct {
// contains filtered or unexported fields
}
SchemaReader - Structure for SchemaReader
func NewSchemaReader ¶
func NewSchemaReader(database *db.Postgres, logger logger.Interface) *SchemaReader
NewSchemaReader - Creates a new SchemaReader
func (*SchemaReader) HeadVersion ¶
func (r *SchemaReader) HeadVersion(ctx context.Context) (version string, err error)
HeadVersion - Finds the latest version of the schema.
func (*SchemaReader) ReadSchema ¶
func (r *SchemaReader) ReadSchema(ctx context.Context, version string) (schema *base.IndexedSchema, err error)
ReadSchema - Reads entity config from the repository.
func (*SchemaReader) ReadSchemaDefinition ¶
func (r *SchemaReader) ReadSchemaDefinition(ctx context.Context, entityType, version string) (definition *base.EntityDefinition, v string, err error)
ReadSchemaDefinition - Reads entity config from the repository.
type SchemaWriter ¶
type SchemaWriter struct {
// contains filtered or unexported fields
}
SchemaWriter - Structure for SchemaWriter
func NewSchemaWriter ¶
func NewSchemaWriter(database *db.Postgres, logger logger.Interface) *SchemaWriter
NewSchemaWriter creates a new SchemaWriter
func (*SchemaWriter) WriteSchema ¶
func (w *SchemaWriter) WriteSchema(ctx context.Context, schemas []repositories.SchemaDefinition) (version string, err error)
WriteSchema writes a schema to the database