domain

package
v0.0.0-...-f514c2e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTag

func NewTag(optFuncs ...MessageOptsFunc) string

Types

type Action

type Action interface {
	Invoke(stub Stub, input map[string]interface{}) (output map[string]interface{}, err error)
}

type MessageOpts

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

type MessageOptsFunc

type MessageOptsFunc func(opt *MessageOpts)

func WithRandomTag

func WithRandomTag() MessageOptsFunc

func WithTag

func WithTag(tag string) MessageOptsFunc

func WithUUID

func WithUUID() MessageOptsFunc

type Output

type Output map[string]interface{}

type Request

type Request struct {
	Tag    string
	Output Output
	Error  error
}

func NewRequest

func NewRequest(output Output) *Request

func NewRequestError

func NewRequestError(err error) *Request

type Response

type Response struct {
	Message map[string]interface{}
	Error   error
}

type Stub

type Stub interface {
	logger.Logger
}

type Trigger

type Trigger interface {
	// Init: must NOT block, start long running processes in a go routine
	Init(stub Stub, config []byte) (err error)

	// NextMessage: request the next message that was produced/receveid by the trigger
	NextMessage() (tag string, message map[string]interface{}, err error)

	// Respond: is called by the adapter base after the message (with tag `tag`), which was initially received
	// by the Trigger, has passed through the actions in the pipeline. Respond is used to send a response back to
	// the caller of the Trigger. In case of an error during invocation of an action component, the adapter base will
	// discontinue invocation of other actions in the pipeline and call Respond.
	Respond(tag string, response map[string]interface{}, err error) error

	Close() error
}

Jump to

Keyboard shortcuts

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