message

package
v0.0.0-...-52eab8c Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToDynamodb_Map

func ToDynamodb_Map(msg Message) (map[string]types.AttributeValue, error)

func ToSNS_Entry

func ToSNS_Entry(msg Message) (*types.PublishBatchRequestEntry, error)

func ToSNS_Input

func ToSNS_Input(msg Message) (*sns.PublishInput, error)

func Write

func Write(ctx context.Context, msg ...Message) error

Types

type Command

type Command = Message

type Event

type Event = Message

type Message

type Message interface {
	Source() string
	ID() string
	Kind() MessageKind
	Type() string
	Time() time.Time
	ContentType() string
	EncodingType() string
	Data(interface{}) error
	Author() string
	Trigger() string
	Transaction() string
}

func FromJson

func FromJson(input []byte) (Message, error)

func FromSNS

func FromSNS(input *events.SNSEntity) (Message, error)

func FromSQS

func FromSQS(message events.SQSMessage) (Message, error)

func FromStream

func FromStream(input events.DynamoDBEventRecord) (Message, error)

type MessageKind

type MessageKind string
const (
	MessageKind_Event   MessageKind = "event"
	MessageKind_Command MessageKind = "command"
)

Jump to

Keyboard shortcuts

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