fs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStateStoreNotLoaded = errors.New("state store not loaded")

Functions

func NewDefaultInstanceFactory

func NewDefaultInstanceFactory() api.FunctionInstanceFactory

Types

type CtxKey

type CtxKey string
const (
	CtxKeyFunctionName  CtxKey = "function-name"
	CtxKeyInstanceIndex CtxKey = "instance-index"
)

type DefaultInstanceFactory

type DefaultInstanceFactory struct {
	api.FunctionInstanceFactory
}

func (*DefaultInstanceFactory) NewFunctionInstance

func (f *DefaultInstanceFactory) NewFunctionInstance(definition *model.Function, funcCtx api.FunctionContext,
	index int32, logger *common.Logger) api.FunctionInstance

type FuncCtxImpl

type FuncCtxImpl struct {
	api.FunctionContext
	// contains filtered or unexported fields
}

func NewFuncCtxImpl

func NewFuncCtxImpl(store api.StateStore) *FuncCtxImpl

func (*FuncCtxImpl) GetState

func (f *FuncCtxImpl) GetState(key string) ([]byte, error)

func (*FuncCtxImpl) PutState

func (f *FuncCtxImpl) PutState(key string, value []byte) error

type FunctionInstanceImpl

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

func (*FunctionInstanceImpl) Context

func (instance *FunctionInstanceImpl) Context() context.Context

func (*FunctionInstanceImpl) Definition

func (instance *FunctionInstanceImpl) Definition() *model.Function

func (*FunctionInstanceImpl) FunctionContext

func (instance *FunctionInstanceImpl) FunctionContext() api.FunctionContext

func (*FunctionInstanceImpl) Index

func (instance *FunctionInstanceImpl) Index() int32

func (*FunctionInstanceImpl) Logger

func (instance *FunctionInstanceImpl) Logger() *common.Logger

func (*FunctionInstanceImpl) Run

func (instance *FunctionInstanceImpl) Run(runtime api.FunctionRuntime, sources []<-chan contube.Record,
	sink chan<- contube.Record)

func (*FunctionInstanceImpl) Stop

func (instance *FunctionInstanceImpl) Stop()

type FunctionManager

type FunctionManager interface {
	StartFunction(f *model.Function) error
	DeleteFunction(namespace, name string) error
	ListFunctions() []string
	ProduceEvent(name string, event contube.Record) error
	ConsumeEvent(name string) (contube.Record, error)
	GetStateStore() api.StateStore
	Close() error
}

func NewFunctionManager

func NewFunctionManager(opts ...ManagerOption) (FunctionManager, error)

type ManagerOption

type ManagerOption interface {
	// contains filtered or unexported methods
}

func WithInstanceFactory

func WithInstanceFactory(factory api.FunctionInstanceFactory) ManagerOption

func WithLogger added in v0.5.0

func WithLogger(log *logr.Logger) ManagerOption

func WithQueueFactory added in v0.5.0

func WithQueueFactory(factory contube.TubeFactory) ManagerOption

func WithRuntimeFactory

func WithRuntimeFactory(name string, factory api.FunctionRuntimeFactory) ManagerOption

func WithStateStore

func WithStateStore(store api.StateStore) ManagerOption

func WithTubeFactory

func WithTubeFactory(name string, factory contube.TubeFactory) ManagerOption

type NamespacedName added in v0.5.0

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

func GetNamespacedName added in v0.5.0

func GetNamespacedName(namespace, name string) NamespacedName

func (NamespacedName) String added in v0.5.0

func (n NamespacedName) String() string

Directories

Path Synopsis
runtime

Jump to

Keyboard shortcuts

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