Version: v0.0.0-...-b45a7ae Latest Latest

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

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




This section is empty.


This section is empty.


This section is empty.


type Accessor

type Accessor interface {
	// Gets all projection instances
	GetAll() ([]Instance, error)

	// Gets all projection instances created for specific entity
	Get(id int64) Instance

	// TODO
	// Gets type/definition
	GetType() (*Definition, error)

	// TODO: experimal attributes API
	// Finds instances based on attributes
	Find(attributes map[string]values.Value, orderBy []query.OrderClause) ([]Instance, error)
	FindByQuery(q Query) ([]Instance, error)


ProjectionAccessor exposes access to projection instances retrieval for domain engine

type ComputeFunc

type ComputeFunc func(base entity.Instance, others map[string][]EntityOrProjectionInstance) values.Values

type Definition

type Definition struct {
	Name         string
	Fields       field.StructType
	BaseSource   entity.Key
	OtherSources map[string]EntityProjectionOtherSource

	// Version of projection definition. Instance is recomputed, if instance's version differs from definition's version.
	Version int64

	Compute ComputeFunc

type EntityOrProjectionInstance

type EntityOrProjectionInstance interface {
	GetId() int64
	GetAllAttributes() values.Values
	GetAttribute(name string) (value interface{})

type EntityProjectionOtherSource

type EntityProjectionOtherSource struct {
	Entity     entity.Key
	Projection string
	Relation   string

type Instance

type Instance interface {
	GetType() string // TODO: strong typing

	GetId() int64
	GetAllAttributes() values.Values
	GetAttribute(name string) (value interface{})

Instance is an instance of specific projection for specific EntityInstance

type Query

type Query struct {
	Root string // TODO: strong typing

	Where query.Expression

	SortBy []query.OrderClause

Jump to

Keyboard shortcuts

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