plugins

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 5

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 PluginError interface {
	Error() string
	GetLocation() string
	GetStackTrace() string
}

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 SFRequestFunc func(requestProvider RequestProvider, typename string, id string, payload *easyjson.JSON, options *easyjson.JSON, timeout ...time.Duration) (*easyjson.JSON, error)

type SFSignalFunc added in v0.1.6

type SFSignalFunc func(signalProvider SignalProvider, typename string, id string, payload *easyjson.JSON, options *easyjson.JSON) error

type SignalProvider added in v0.1.1

type SignalProvider int
const (
	AutoSignalSelect SignalProvider = iota
	JetstreamGlobalSignal
	GolangLocalSignal
)

type StatefunAddress

type StatefunAddress struct {
	Typename string
	ID       string
}

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 SyncReply added in v0.1.3

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

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