projectionengine

package
v0.0.0-...-b45a7ae Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQuery

func BuildQuery(name string, instance projection.EntityOrProjectionInstance, source projection.EntityProjectionOtherSource) (string, []interface{})

Types

type Engine

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

func New

func New(persistence Persistence) *Engine

func (*Engine) Close

func (engine *Engine) Close()

func (*Engine) ProjectionRepository

func (engine *Engine) ProjectionRepository(name string) domain.ProjectionProvider

func (*Engine) SetSchema

func (engine *Engine) SetSchema(
	schema *model.Schema,
)

func (*Engine) WrapEntityRepository

func (engine *Engine) WrapEntityRepository(repository entity.Repository) entity.Repository

type Persistence

type Persistence interface {
	Entity(name entity.Key) entity.Repository

	ProjectionRepository(name string) ProjectionRepository
	ProjectionFactory(name string) ProjectionFactory
}

interface Persistence specifies persistence port for for Engine

type ProjectionFactory

type ProjectionFactory interface {
	CreateFromMap(values map[string]interface{}) projection.Instance
}

type ProjectionListenFunc

type ProjectionListenFunc func(instance projection.Instance, previousInstance projection.Instance)

type ProjectionProvider

type ProjectionProvider interface {
	domain.ProjectionProvider

	Name() string
	Invalidate(instance entity.Instance, previousVersion entity.Instance)
	InvalidateOnProjectionChange(instance projection.Instance, previousInstance projection.Instance)

	Close()
}

type ProjectionRepository

type ProjectionRepository interface {
	Get(entityId int64) (instance projection.Instance, found bool)

	FindAll() ([]projection.Instance, error)
	FindByQuery(query string, params []interface{}, orderBy []query.OrderClause) ([]projection.Instance, error)

	Store(id int64, instance projection.Instance)

	DeleteAll()
	Delete(id int64)
}

Jump to

Keyboard shortcuts

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