Documentation
¶
Overview ¶
Foliage primary statefun package. Provides all everything that is needed for Foliage stateful functions and Foliage applications
Index ¶
- Constants
- 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 FunctionHandler
- 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
- type GoMsg
- type Runtime
- func (r *Runtime) IngressGolangSync(typename string, id string, payload *easyjson.JSON, options *easyjson.JSON) (*easyjson.JSON, error)
- func (r *Runtime) IngressNATS(typename string, id string, payload *easyjson.JSON, options *easyjson.JSON)
- func (r *Runtime) Start(cacheConfig *cache.Config, onAfterStart func(runtime *Runtime)) (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
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 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 FunctionHandler ¶
type FunctionHandler func(sfPlugins.StatefunExecutor, *sfPlugins.StatefunContextProcessor)
type FunctionType ¶
type FunctionType struct {
// contains filtered or unexported fields
}
func NewFunctionType ¶
func NewFunctionType(runtime *Runtime, name string, handler FunctionHandler, config FunctionTypeConfig) *FunctionType
func (*FunctionType) SetExecutor ¶
func (ft *FunctionType) SetExecutor(alias string, content string, constructor func(alias string, source string) sfPlugins.StatefunExecutor) error
func (*FunctionType) Start ¶
func (ft *FunctionType) Start(streamName string) 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
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(config RuntimeConfig) (r *Runtime, err error)
func (*Runtime) IngressGolangSync ¶
func (*Runtime) IngressNATS ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.