action

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueActionNameType = "action_names"

	AddedEventType       = eventTypePrefix + "added"
	ChangedEventType     = eventTypePrefix + "changed"
	DeactivatedEventType = eventTypePrefix + "deactivated"
	ReactivatedEventType = eventTypePrefix + "reactivated"
	RemovedEventType     = eventTypePrefix + "removed"
)
View Source
const (
	AggregateType    = "action"
	AggregateVersion = "v1"
)

Variables

This section is empty.

Functions

func AddedEventMapper

func AddedEventMapper(event *repository.Event) (eventstore.Event, error)

func ChangeAllowedToFail

func ChangeAllowedToFail(allowedToFail bool) func(event *ChangedEvent)

func ChangeName

func ChangeName(name, oldName string) func(event *ChangedEvent)

func ChangeScript

func ChangeScript(script string) func(event *ChangedEvent)

func ChangeTimeout

func ChangeTimeout(timeout time.Duration) func(event *ChangedEvent)

func ChangedEventMapper

func ChangedEventMapper(event *repository.Event) (eventstore.Event, error)

func DeactivatedEventMapper

func DeactivatedEventMapper(event *repository.Event) (eventstore.Event, error)

func NewAddActionNameUniqueConstraint

func NewAddActionNameUniqueConstraint(actionName, resourceOwner string) *eventstore.EventUniqueConstraint

func NewRemoveActionNameUniqueConstraint

func NewRemoveActionNameUniqueConstraint(actionName, resourceOwner string) *eventstore.EventUniqueConstraint

func ReactivatedEventMapper

func ReactivatedEventMapper(event *repository.Event) (eventstore.Event, error)

func RegisterEventMappers

func RegisterEventMappers(es *eventstore.Eventstore)

func RemovedEventMapper

func RemovedEventMapper(event *repository.Event) (eventstore.Event, error)

Types

type ActionChanges

type ActionChanges func(event *ChangedEvent)

type AddedEvent

type AddedEvent struct {
	eventstore.BaseEvent `json:"-"`

	Name          string        `json:"name"`
	Script        string        `json:"script,omitempty"`
	Timeout       time.Duration `json:"timeout,omitempty"`
	AllowedToFail bool          `json:"allowedToFail"`
}

func NewAddedEvent

func NewAddedEvent(
	ctx context.Context,
	aggregate *eventstore.Aggregate,
	name,
	script string,
	timeout time.Duration,
	allowedToFail bool,
) *AddedEvent

func (*AddedEvent) Data

func (e *AddedEvent) Data() interface{}

func (*AddedEvent) UniqueConstraints

func (e *AddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint

type Aggregate

type Aggregate struct {
	eventstore.Aggregate
}

func NewAggregate

func NewAggregate(id, resourceOwner string) *Aggregate

type ChangedEvent

type ChangedEvent struct {
	eventstore.BaseEvent `json:"-"`

	Name          *string        `json:"name,omitempty"`
	Script        *string        `json:"script,omitempty"`
	Timeout       *time.Duration `json:"timeout,omitempty"`
	AllowedToFail *bool          `json:"allowedToFail,omitempty"`
	// contains filtered or unexported fields
}

func NewChangedEvent

func NewChangedEvent(
	ctx context.Context,
	aggregate *eventstore.Aggregate,
	changes []ActionChanges,
) (*ChangedEvent, error)

func (*ChangedEvent) Data

func (e *ChangedEvent) Data() interface{}

func (*ChangedEvent) UniqueConstraints

func (e *ChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint

type DeactivatedEvent

type DeactivatedEvent struct {
	eventstore.BaseEvent `json:"-"`
}

func NewDeactivatedEvent

func NewDeactivatedEvent(ctx context.Context, aggregate *eventstore.Aggregate) *DeactivatedEvent

func (*DeactivatedEvent) Data

func (e *DeactivatedEvent) Data() interface{}

func (*DeactivatedEvent) UniqueConstraints

func (e *DeactivatedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint

type ReactivatedEvent

type ReactivatedEvent struct {
	eventstore.BaseEvent `json:"-"`
}

func NewReactivatedEvent

func NewReactivatedEvent(ctx context.Context, aggregate *eventstore.Aggregate) *ReactivatedEvent

func (*ReactivatedEvent) Data

func (e *ReactivatedEvent) Data() interface{}

func (*ReactivatedEvent) UniqueConstraints

func (e *ReactivatedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint

type RemovedEvent

type RemovedEvent struct {
	eventstore.BaseEvent `json:"-"`
	// contains filtered or unexported fields
}

func NewRemovedEvent

func NewRemovedEvent(
	ctx context.Context,
	aggregate *eventstore.Aggregate,
	name string,
) *RemovedEvent

func (*RemovedEvent) Data

func (e *RemovedEvent) Data() interface{}

func (*RemovedEvent) UniqueConstraints

func (e *RemovedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint

Jump to

Keyboard shortcuts

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