runtime

package
v2.1.1-dev.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewFunctionPipeline added in v2.1.0

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 added in v2.1.0

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

NewGolangRuntime creates and initializes the GolangRuntime instance

func (*GolangRuntime) AddFunctionsPipeline added in v2.1.0

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

AddFunctionsPipeline is thread safe to set transforms

func (*GolangRuntime) ClearAllFunctionsPipelineTransforms added in v2.1.0

func (gr *GolangRuntime) ClearAllFunctionsPipelineTransforms()

ClearAllFunctionsPipelineTransforms clears the transforms for all existing function pipelines.

func (*GolangRuntime) ExecutePipeline

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

func (*GolangRuntime) GetDefaultPipeline added in v2.1.0

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

func (*GolangRuntime) GetMatchingPipelines added in v2.1.0

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

func (*GolangRuntime) GetPipelineById added in v2.1.0

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

func (*GolangRuntime) ProcessMessage

func (gr *GolangRuntime) ProcessMessage(
	appContext *appfunction.Context,
	envelope types.MessageEnvelope,
	pipeline *interfaces.FunctionPipeline) *MessageError

ProcessMessage sends the contents of the message through the functions pipeline

func (*GolangRuntime) SetDefaultFunctionsPipeline added in v2.1.0

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

SetDefaultFunctionsPipeline sets the default function pipeline

func (*GolangRuntime) SetFunctionsPipelineTransforms added in v2.1.0

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