runtime

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicWildCard       = "#"
	TopicLevelSeparator = "/"
)

Variables

This section is empty.

Functions

func NewFunctionPipeline

func NewFunctionPipeline(id string, topics []string, transforms []interfaces.AppFunction) interfaces.FunctionPipeline

Types

type GolangRuntime

type GolangRuntime struct {
	TargetType interface{}
	ServiceKey string
	// contains filtered or unexported fields
}

GolangRuntime represents the golang runtime environment

func NewGolangRuntime

func NewGolangRuntime(serviceKey string, targetType interface{}, dic *di.Container) *GolangRuntime

NewGolangRuntime creates and initializes the GolangRuntime instance

func (*GolangRuntime) AddFunctionsPipeline

func (gr *GolangRuntime) AddFunctionsPipeline(id string, topics []string, transforms []interfaces.AppFunction) error

AddFunctionsPipeline is thread safe to set transforms

func (*GolangRuntime) ClearAllFunctionsPipelineTransforms

func (gr *GolangRuntime) ClearAllFunctionsPipelineTransforms()

ClearAllFunctionsPipelineTransforms clears the transforms for all existing function pipelines.

func (*GolangRuntime) DecodeMessage

func (gr *GolangRuntime) DecodeMessage(appContext *appfunction.Context, envelope types.MessageEnvelope) (interface{}, *MessageError, bool)

DecodeMessage decode the message wrapped in the MessageEnvelope and return the data to be processed.

func (*GolangRuntime) ExecutePipeline

func (gr *GolangRuntime) ExecutePipeline(
	target interface{},
	appContext *appfunction.Context,
	pipeline *interfaces.FunctionPipeline,
	startPosition int,
	isRetry bool) *MessageError

func (*GolangRuntime) GetDefaultPipeline

func (gr *GolangRuntime) GetDefaultPipeline() *interfaces.FunctionPipeline

func (*GolangRuntime) GetMatchingPipelines

func (gr *GolangRuntime) GetMatchingPipelines(incomingTopic string) []*interfaces.FunctionPipeline

func (*GolangRuntime) GetPipelineById

func (gr *GolangRuntime) GetPipelineById(id string) *interfaces.FunctionPipeline

func (*GolangRuntime) ProcessMessage

func (gr *GolangRuntime) ProcessMessage(appContext *appfunction.Context, target interface{}, pipeline *interfaces.FunctionPipeline) *MessageError

ProcessMessage sends the contents of the message through the functions pipeline

func (*GolangRuntime) SetDefaultFunctionsPipeline

func (gr *GolangRuntime) SetDefaultFunctionsPipeline(transforms []interfaces.AppFunction)

SetDefaultFunctionsPipeline sets the default function pipeline

func (*GolangRuntime) SetFunctionsPipelineTopics

func (gr *GolangRuntime) SetFunctionsPipelineTopics(id string, topics []string)

SetFunctionsPipelineTopics sets the topics for an existing function pipeline. Non-existent pipelines are ignored

func (*GolangRuntime) SetFunctionsPipelineTransforms

func (gr *GolangRuntime) SetFunctionsPipelineTransforms(id string, transforms []interfaces.AppFunction)

SetFunctionsPipelineTransforms sets the transforms for an existing function pipeline. Non-existent pipelines are ignored

func (*GolangRuntime) StartStoreAndForward

func (gr *GolangRuntime) StartStoreAndForward(
	appWg *sync.WaitGroup,
	appCtx context.Context,
	enabledWg *sync.WaitGroup,
	enabledCtx context.Context,
	serviceKey string)

type MessageError

type MessageError struct {
	Err       error
	ErrorCode int
}

Jump to

Keyboard shortcuts

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