plugins

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Overview

Foliage statefun plugins package. Provides unified interfaces for stateful functions plugins

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestProvider added in v0.1.1

type RequestProvider int
const (
	NatsCoreGlobalRequest RequestProvider = iota
	GolangLocalRequest
)

type SignalProvider added in v0.1.1

type SignalProvider int
const (
	JetstreamGlobalSignal SignalProvider = iota
)

type StatefunAddress

type StatefunAddress struct {
	Typename string
	ID       string
}

type StatefunContextProcessor

type StatefunContextProcessor struct {
	GlobalCache        *cache.Store
	GetFunctionContext func() *easyjson.JSON
	SetFunctionContext func(*easyjson.JSON)
	GetObjectContext   func() *easyjson.JSON
	SetObjectContext   func(*easyjson.JSON)
	// TODO: DownstreamSignal(<function type>, <links filters>, <payload>, <options>)
	Signal           func(SignalProvider, string, string, *easyjson.JSON, *easyjson.JSON) error
	Request          func(RequestProvider, string, string, *easyjson.JSON, *easyjson.JSON) (*easyjson.JSON, error)
	Self             StatefunAddress
	Caller           StatefunAddress
	Payload          *easyjson.JSON
	Options          *easyjson.JSON
	RequestReplyData *easyjson.JSON // when requested in function: nil - function was signaled, !nil - function was requested
}

type StatefunExecutor

type StatefunExecutor interface {
	Run(contextProcessor *StatefunContextProcessor) error
	BuildError() error
}

type StatefunExecutorConstructor

type StatefunExecutorConstructor func(alias string, source string) StatefunExecutor

type TypenameExecutorPlugin

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

func NewTypenameExecutor

func NewTypenameExecutor(alias string, source string, executorContructorFunction StatefunExecutorConstructor) *TypenameExecutorPlugin

func (*TypenameExecutorPlugin) AddForID

func (tnex *TypenameExecutorPlugin) AddForID(id string)

func (*TypenameExecutorPlugin) GetForID

func (tnex *TypenameExecutorPlugin) GetForID(id string) StatefunExecutor

func (*TypenameExecutorPlugin) RemoveForID

func (tnex *TypenameExecutorPlugin) RemoveForID(id string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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