message

package
v0.0.65 Latest Latest
Warning

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

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

Documentation

Overview

Package message contains the message creation strategies

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityHint

type EntityHint struct {
	ProviderImplementsHint string `json:"provider_implements_hint"`
	ProviderClassHint      string `json:"provider_class_hint"`
}

EntityHint is a hint that is used to help the entity handler find the entity.

type HandleEntityAndDoMessage

type HandleEntityAndDoMessage struct {
	Entity     TypedProps `json:"entity"`
	Originator TypedProps `json:"owner"`
	Hint       EntityHint `json:"hint"`
}

HandleEntityAndDoMessage is a message that is sent to the entity handler to refresh an entity and perform an action.

func NewEntityRefreshAndDoMessage

func NewEntityRefreshAndDoMessage() *HandleEntityAndDoMessage

NewEntityRefreshAndDoMessage creates a new HandleEntityAndDoMessage struct.

func ToEntityRefreshAndDo

func ToEntityRefreshAndDo(msg *message.Message) (*HandleEntityAndDoMessage, error)

ToEntityRefreshAndDo converts a Watermill message to a HandleEntityAndDoMessage struct.

func (*HandleEntityAndDoMessage) ToMessage

func (e *HandleEntityAndDoMessage) ToMessage(msg *message.Message) error

ToMessage converts the HandleEntityAndDoMessage struct to a Watermill message.

func (*HandleEntityAndDoMessage) WithEntity

func (e *HandleEntityAndDoMessage) WithEntity(entType v1.Entity, getByProps *properties.Properties) *HandleEntityAndDoMessage

WithEntity sets the entity and its properties.

func (*HandleEntityAndDoMessage) WithEntityID

func (e *HandleEntityAndDoMessage) WithEntityID(entityID uuid.UUID) *HandleEntityAndDoMessage

WithEntityID sets the entity ID for the entity that will be used when looking up the entity.

func (*HandleEntityAndDoMessage) WithOriginator

func (e *HandleEntityAndDoMessage) WithOriginator(
	originatorType v1.Entity, originatorProps *properties.Properties,
) *HandleEntityAndDoMessage

WithOriginator sets the owner entity and its properties.

func (*HandleEntityAndDoMessage) WithProviderClassHint

func (e *HandleEntityAndDoMessage) WithProviderClassHint(providerClassHint string) *HandleEntityAndDoMessage

WithProviderClassHint sets the provider hint for the entity that will be used when looking up the entity. to the provider class

func (*HandleEntityAndDoMessage) WithProviderImplementsHint

func (e *HandleEntityAndDoMessage) WithProviderImplementsHint(providerHint string) *HandleEntityAndDoMessage

WithProviderImplementsHint sets the provider hint for the entity that will be used when looking up the entity. to the provider implements hint

type TypedProps

type TypedProps struct {
	Type       v1.Entity      `json:"type"`
	EntityID   uuid.UUID      `json:"entity_id"`
	GetByProps map[string]any `json:"get_by_props"`
}

TypedProps is a struct that contains the type of entity and its properties. it is used for either the entity or the owner entity.

Jump to

Keyboard shortcuts

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