aggregate

package
v0.0.0-...-4518f94 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowCheckForNoChanges

func AllowCheckForNoChanges(appSource, loggedInUserId string) bool

func CreateEvent

func CreateEvent(ctx context.Context, operationName string,
	aggregate eventstore.Aggregate, command TenantEventInterface,
	createEvent func() (eventstore.Event, error)) error

func EnrichEventWithMetadata

func EnrichEventWithMetadata(event *eventstore.Event, span *opentracing.Span, tenant, userId string)

Deprecated, use EnrichEventWithMetadataExtended instead

func EnrichEventWithMetadataExtended

func EnrichEventWithMetadataExtended(event *eventstore.Event, span opentracing.Span, mtd EventMetadata)

func GetAggregateObjectID

func GetAggregateObjectID(aggregateID, tenant string, aggregateType eventstore.AggregateType) string

func GetAggregateWithIdObjectID

func GetAggregateWithIdObjectID(aggregateID string, aggregateType eventstore.AggregateType) string

func GetAggregateWithTenantAndIdObjectID

func GetAggregateWithTenantAndIdObjectID(aggregateID string, aggregateType eventstore.AggregateType, tenant string) string

func GetTempAggregateWithTenantAndIdObjectID

func GetTempAggregateWithTenantAndIdObjectID(aggregateID string, aggregateType eventstore.AggregateType, tenant string) string

func GetTenantFromAggregate

func GetTenantFromAggregate(aggregateID string, aggregateType eventstore.AggregateType) string

Types

type CommonIdAggregate

type CommonIdAggregate struct {
	*eventstore.AggregateBase
	// contains filtered or unexported fields
}

func LoadCommonAggregateWithId

func LoadCommonAggregateWithId(ctx context.Context, eventStore eventstore.AggregateStore, aggregateType eventstore.AggregateType, objectID string) (*CommonIdAggregate, error)

func NewCommonAggregateWithId

func NewCommonAggregateWithId(aggregateType eventstore.AggregateType, id string) *CommonIdAggregate

func (*CommonIdAggregate) HandleGRPCRequest

func (a *CommonIdAggregate) HandleGRPCRequest(ctx context.Context, request any, params map[string]any) (any, error)

func (CommonIdAggregate) NotFound

func (a CommonIdAggregate) NotFound() bool

func (*CommonIdAggregate) SetWhen

func (a *CommonIdAggregate) SetWhen(when func(event eventstore.Event) error)

func (*CommonIdAggregate) When

func (a *CommonIdAggregate) When(event eventstore.Event) error

type CommonTenantIdAggregate

type CommonTenantIdAggregate struct {
	*eventstore.AggregateBase
	// contains filtered or unexported fields
}

func NewCommonAggregate

func NewCommonAggregate(aggregateType eventstore.AggregateType) *CommonTenantIdAggregate

func NewCommonAggregateWithTenantAndId

func NewCommonAggregateWithTenantAndId(aggregateType eventstore.AggregateType, tenant, id string) *CommonTenantIdAggregate

func (*CommonTenantIdAggregate) HandleGRPCRequest

func (a *CommonTenantIdAggregate) HandleGRPCRequest(ctx context.Context, request any, params map[string]any) (any, error)

func (CommonTenantIdAggregate) NotFound

func (a CommonTenantIdAggregate) NotFound() bool

func (*CommonTenantIdAggregate) SetWhen

func (a *CommonTenantIdAggregate) SetWhen(when func(event eventstore.Event) error)

func (*CommonTenantIdAggregate) When

type CommonTenantIdTempAggregate

type CommonTenantIdTempAggregate struct {
	*eventstore.AggregateBase
	// contains filtered or unexported fields
}

func LoadCommonTempAggregateWithTenantAndId

func LoadCommonTempAggregateWithTenantAndId(ctx context.Context, eventStore eventstore.AggregateStore, aggregateType eventstore.AggregateType, tenant, objectID string) (*CommonTenantIdTempAggregate, error)

func NewCommonTempAggregate

func NewCommonTempAggregate(aggregateType eventstore.AggregateType) *CommonTenantIdTempAggregate

func NewCommonTempAggregateWithTenantAndId

func NewCommonTempAggregateWithTenantAndId(aggregateType eventstore.AggregateType, tenant, id string) *CommonTenantIdTempAggregate

func (*CommonTenantIdTempAggregate) HandleGRPCRequest

func (a *CommonTenantIdTempAggregate) HandleGRPCRequest(ctx context.Context, request any, params map[string]any) (any, error)

func (*CommonTenantIdTempAggregate) IsTemporal

func (a *CommonTenantIdTempAggregate) IsTemporal() bool

func (CommonTenantIdTempAggregate) NotFound

func (a CommonTenantIdTempAggregate) NotFound() bool

func (*CommonTenantIdTempAggregate) SetWhen

func (a *CommonTenantIdTempAggregate) SetWhen(when func(event eventstore.Event) error)

func (*CommonTenantIdTempAggregate) When

type EventMetadata

type EventMetadata struct {
	Tenant string `json:"tenant"`
	UserId string `json:"user-id"`
	App    string `json:"app"`
}

type TenantEventInterface

type TenantEventInterface interface {
	GetTenant() string
}

Jump to

Keyboard shortcuts

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