domain

package
v0.0.0-...-23becbe Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUUID

func NewUUID() string

func Validate

func Validate(obj ObjectValidator) error

Types

type Aggregate

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

func NewAggregate

func NewAggregate() Aggregate

func (Aggregate) Notify

func (a Aggregate) Notify(ctx context.Context, event Event, payload interface{})

func (Aggregate) RegisterEventHandler

func (a Aggregate) RegisterEventHandler(event Event, handler EventHandler)

type BaseEntity

type BaseEntity struct {
	UID string `json:"uid" validate:"required,uuid4"`
}

func NewBaseEntity

func NewBaseEntity() BaseEntity

type BasePersistent

type BasePersistent struct {
	ID        int       `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

func NewBasePersistent

func NewBasePersistent() BasePersistent

type Event

type Event string

func (Event) String

func (e Event) String() string

type EventHandler

type EventHandler interface {
	Handle(ctx context.Context, payload interface{})
}

type ObjectValidator

type ObjectValidator interface {
	Validate() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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