plugins

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

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)
	ObjectMutexLock    func(errorOnLocked bool) error
	ObjectMutexUnlock  func() error
	// 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
	Reply   *SyncReply // 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 SyncReply added in v0.1.3

type SyncReply struct {
	With          func(*easyjson.JSON)
	CancelDefault func()
}

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