runtime

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 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

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) ExecutePipeline

func (gr *GolangRuntime) ExecutePipeline(
	target interface{},
	contentType string,
	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,
	envelope types.MessageEnvelope,
	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) error

SetDefaultFunctionsPipeline sets the default function pipeline

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