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 Domain ¶ added in v0.1.6
type Domain interface {
HubDomainName() string
Name() string
Cache() *cache.Store
GetDomainFromObjectID(objectID string) string
GetObjectIDWithoutDomain(objectID string) string
CreateObjectIDWithDomain(domain string, objectID string, domainReplace bool) string
CreateObjectIDWithThisDomain(objectID string, domainReplace bool) string
CreateObjectIDWithHubDomain(objectID string, domainReplace bool) string
// Get all domains in weak cluster including this one
GetWeakClusterDomains() []string
// Set all domains in weak cluster (this domain name will also be included automatically if not defined)
SetWeakClusterDomains(weakClusterDomains []string)
/*
* otherDomainName/ObjectId -> thisDomainName/otherDomainName#ObjectId
* thisDomainName/ObjectId -> thisDomainName/ObjectId
*/
GetShadowObjectShadowId(objectIdWithAnyDomainName string) string
/*
* domainName1/domainName2#ObjectId -> domainName2, ObjectId
*/
GetShadowObjectDomainAndID(shadowObjectId string) (domainName, objectIdWithoutDomain string, err error)
/*
* domainName1/domainName2#ObjectId -> true
* domainName1/ObjectId -> false
*/
IsShadowObject(idWithDomain string) bool
GetValidObjectId(objectId string) string
CreateCustomShadowId(storeDomain, targetDomain, uuid string) string
}
type EgressProvider ¶ added in v0.1.6
type EgressProvider int
const (
NatsCoreEgress EgressProvider = iota
)
type PluginError ¶ added in v0.1.6
type RequestProvider ¶ added in v0.1.1
type RequestProvider int
const ( AutoRequestSelect RequestProvider = iota NatsCoreGlobalRequest GolangLocalRequest )
type SFEgressFunc ¶ added in v0.1.6
type SFEgressFunc func(egressProvider EgressProvider, payload *easyjson.JSON, customId ...string) error
type SFRequestFunc ¶ added in v0.1.6
type SFSignalFunc ¶ added in v0.1.6
type SignalProvider ¶ added in v0.1.1
type SignalProvider int
const ( AutoSignalSelect SignalProvider = iota JetstreamGlobalSignal GolangLocalSignal )
type StatefunAddress ¶
type StatefunContextProcessor ¶
type StatefunContextProcessor struct {
GetFunctionContext func() *easyjson.JSON
SetFunctionContext func(*easyjson.JSON)
SetContextExpirationAfter func(time.Duration)
GetObjectContext func() *easyjson.JSON
SetObjectContext func(*easyjson.JSON)
ObjectMutexLock func(objectId string, errorOnLocked bool) error
ObjectMutexUnlock func(objectId string) error
Domain Domain
// TODO: DownstreamSignal(<function type>, <links filters>, <payload>, <options>)
Signal SFSignalFunc
Request SFRequestFunc
Egress SFEgressFunc
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(ctx *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)
Click to show internal directories.
Click to hide internal directories.