Documentation
¶
Overview ¶
Foliage primary statefun package. Provides all everything that is needed for Foliage stateful functions and Foliage applications
Index ¶
- Constants
- func AddRequestSourceNatsCore(ft *FunctionType) error
- func AddSignalSourceJetstreamQueuePushConsumer(ft *FunctionType, streamName string) error
- func ContextMutexLock(ft *FunctionType, id string, errorOnLocked bool) (uint64, error)
- func ContextMutexUnlock(ft *FunctionType, id string, lockRevisionID uint64) error
- func FunctionTypeMutexLock(ft *FunctionType, errorOnLocked bool) (uint64, error)
- func FunctionTypeMutexUnlock(ft *FunctionType, lockRevisionID uint64) error
- func KeyMutexLock(runtime *Runtime, key string, errorOnLocked bool, debugCaller ...string) (uint64, error)
- func KeyMutexUnlock(runtime *Runtime, key string, lockRevisionID uint64, debugCaller ...string) error
- type FunctionLogicHandler
- type FunctionType
- type FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SeMsgChannelSize(msgChannelSize int) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetBalanceNeeded(balanceNeeded bool) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetMsgAckChannelSize(msgAckChannelSize int) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetMsgAckWaitMs(msgAckWaitMs int) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetMutexLifeTimeSec(mutexLifeTimeSec int) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetOptions(options *easyjson.JSON) *FunctionTypeConfig
- func (ftc *FunctionTypeConfig) SetServiceState(active bool) *FunctionTypeConfig
- type FunctionTypeMsg
- type HandlerMsgRefusalType
- type RefusalCallbackAction
- type RequestCallbackAction
- type Runtime
- func (r *Runtime) Request(requestProvider sfPlugins.RequestProvider, typename string, id string, ...) (*easyjson.JSON, error)
- func (r *Runtime) Signal(signalProvider sfPlugins.SignalProvider, typename string, id string, ...) error
- func (r *Runtime) Start(cacheConfig *cache.Config, onAfterStart func(runtime *Runtime) error) (err error)
- type RuntimeConfig
- func (ro *RuntimeConfig) SeKeyValueStoreBucketName(keyValueStoreBucketName string) *RuntimeConfig
- func (ro *RuntimeConfig) SetFunctionTypeIDLifetimeMs(functionTypeIDLifetimeMs int) *RuntimeConfig
- func (ro *RuntimeConfig) SetFunctionTypesStreamName(functionTypesStreamName string) *RuntimeConfig
- func (ro *RuntimeConfig) SetIngressCallGoLangSyncTimeoutSec(ingressCallGoLangSyncTimeoutSec int) *RuntimeConfig
- func (ro *RuntimeConfig) SetKVMutexIsOldPollingIntervalSec(kvMutexIsOldPollingIntervalSec int) *RuntimeConfig
- func (ro *RuntimeConfig) SetKVMutexLifeTimeSec(kvMutexLifeTimeSec int) *RuntimeConfig
- func (ro *RuntimeConfig) SetNatsURL(natsURL string) *RuntimeConfig
- type SignalCallbackAction
Constants ¶
View Source
const ( MsgAckWaitTimeoutMs = 10000 MsgChannelSize = 64 MsgAckChannelSize = 64 BalanceNeeded = true MutexLifetimeSec = 120 )
View Source
const ( NatsURL = "nats://nats:foliage@nats:4222" RuntimeName = "foliage_runtime" KeyValueStoreBucketName = RuntimeName + "_kv_store" FunctionTypesStreamName = RuntimeName + "_stream" KVMutexLifetimeSec = 120 KVMutexIsOldPollingInterval = 10 FunctionTypeIDLifetimeMs = 5000 IngressCallGolangSyncTimeout = 60 )
Variables ¶
This section is empty.
Functions ¶
func AddRequestSourceNatsCore ¶ added in v0.1.1
func AddRequestSourceNatsCore(ft *FunctionType) error
func AddSignalSourceJetstreamQueuePushConsumer ¶ added in v0.1.1
func AddSignalSourceJetstreamQueuePushConsumer(ft *FunctionType, streamName string) error
func ContextMutexLock ¶
func ContextMutexLock(ft *FunctionType, id string, errorOnLocked bool) (uint64, error)
func ContextMutexUnlock ¶
func ContextMutexUnlock(ft *FunctionType, id string, lockRevisionID uint64) error
func FunctionTypeMutexLock ¶
func FunctionTypeMutexLock(ft *FunctionType, errorOnLocked bool) (uint64, error)
func FunctionTypeMutexUnlock ¶
func FunctionTypeMutexUnlock(ft *FunctionType, lockRevisionID uint64) error
func KeyMutexLock ¶
Types ¶
type FunctionLogicHandler ¶ added in v0.1.1
type FunctionLogicHandler func(sfPlugins.StatefunExecutor, *sfPlugins.StatefunContextProcessor)
type FunctionType ¶
type FunctionType struct {
// contains filtered or unexported fields
}
func NewFunctionType ¶
func NewFunctionType(runtime *Runtime, name string, logicHandler FunctionLogicHandler, config FunctionTypeConfig) *FunctionType
func (*FunctionType) SetExecutor ¶
func (ft *FunctionType) SetExecutor(alias string, content string, constructor func(alias string, source string) sfPlugins.StatefunExecutor) error
type FunctionTypeConfig ¶
type FunctionTypeConfig struct {
// contains filtered or unexported fields
}
func NewFunctionTypeConfig ¶
func NewFunctionTypeConfig() *FunctionTypeConfig
func (*FunctionTypeConfig) SeMsgChannelSize ¶
func (ftc *FunctionTypeConfig) SeMsgChannelSize(msgChannelSize int) *FunctionTypeConfig
func (*FunctionTypeConfig) SetBalanceNeeded ¶
func (ftc *FunctionTypeConfig) SetBalanceNeeded(balanceNeeded bool) *FunctionTypeConfig
func (*FunctionTypeConfig) SetMsgAckChannelSize ¶
func (ftc *FunctionTypeConfig) SetMsgAckChannelSize(msgAckChannelSize int) *FunctionTypeConfig
func (*FunctionTypeConfig) SetMsgAckWaitMs ¶
func (ftc *FunctionTypeConfig) SetMsgAckWaitMs(msgAckWaitMs int) *FunctionTypeConfig
func (*FunctionTypeConfig) SetMutexLifeTimeSec ¶
func (ftc *FunctionTypeConfig) SetMutexLifeTimeSec(mutexLifeTimeSec int) *FunctionTypeConfig
func (*FunctionTypeConfig) SetOptions ¶
func (ftc *FunctionTypeConfig) SetOptions(options *easyjson.JSON) *FunctionTypeConfig
func (*FunctionTypeConfig) SetServiceState ¶ added in v0.1.1
func (ftc *FunctionTypeConfig) SetServiceState(active bool) *FunctionTypeConfig
type FunctionTypeMsg ¶ added in v0.1.1
type FunctionTypeMsg struct {
Caller *sfPlugins.StatefunAddress
Payload *easyjson.JSON
Options *easyjson.JSON
RefusalCallback RefusalCallbackAction
RequestCallback RequestCallbackAction
AckCallback SignalCallbackAction
}
type HandlerMsgRefusalType ¶ added in v0.1.1
type HandlerMsgRefusalType int
type RefusalCallbackAction ¶ added in v0.1.1
type RefusalCallbackAction = func()
type RequestCallbackAction ¶ added in v0.1.1
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(config RuntimeConfig) (r *Runtime, err error)
type RuntimeConfig ¶
type RuntimeConfig struct {
// contains filtered or unexported fields
}
func NewRuntimeConfig ¶
func NewRuntimeConfig() *RuntimeConfig
func NewRuntimeConfigSimple ¶
func NewRuntimeConfigSimple(natsURL string, runtimeName string) *RuntimeConfig
func (*RuntimeConfig) SeKeyValueStoreBucketName ¶
func (ro *RuntimeConfig) SeKeyValueStoreBucketName(keyValueStoreBucketName string) *RuntimeConfig
func (*RuntimeConfig) SetFunctionTypeIDLifetimeMs ¶
func (ro *RuntimeConfig) SetFunctionTypeIDLifetimeMs(functionTypeIDLifetimeMs int) *RuntimeConfig
func (*RuntimeConfig) SetFunctionTypesStreamName ¶
func (ro *RuntimeConfig) SetFunctionTypesStreamName(functionTypesStreamName string) *RuntimeConfig
func (*RuntimeConfig) SetIngressCallGoLangSyncTimeoutSec ¶
func (ro *RuntimeConfig) SetIngressCallGoLangSyncTimeoutSec(ingressCallGoLangSyncTimeoutSec int) *RuntimeConfig
func (*RuntimeConfig) SetKVMutexIsOldPollingIntervalSec ¶
func (ro *RuntimeConfig) SetKVMutexIsOldPollingIntervalSec(kvMutexIsOldPollingIntervalSec int) *RuntimeConfig
func (*RuntimeConfig) SetKVMutexLifeTimeSec ¶
func (ro *RuntimeConfig) SetKVMutexLifeTimeSec(kvMutexLifeTimeSec int) *RuntimeConfig
func (*RuntimeConfig) SetNatsURL ¶
func (ro *RuntimeConfig) SetNatsURL(natsURL string) *RuntimeConfig
type SignalCallbackAction ¶ added in v0.1.1
type SignalCallbackAction = func(ack bool)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.