plugins

package
v0.1.7-cachejson-hotfix-1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 6 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 LinkQuery

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

func NewLinkQuery

func NewLinkQuery(lt string) LinkQuery

func (*LinkQuery) GetCustom

func (lq *LinkQuery) GetCustom() string

func (*LinkQuery) GetFilter

func (lq *LinkQuery) GetFilter() map[string]interface{}

func (*LinkQuery) GetName

func (lq *LinkQuery) GetName() string

func (*LinkQuery) GetTags

func (lq *LinkQuery) GetTags() []string

func (*LinkQuery) GetType

func (lq *LinkQuery) GetType() string

func (*LinkQuery) Validate

func (lq *LinkQuery) Validate() error

func (*LinkQuery) WithCustom

func (lq *LinkQuery) WithCustom(custom string)

func (*LinkQuery) WithFilter

func (lq *LinkQuery) WithFilter(filter map[string]interface{})

func (*LinkQuery) WithName

func (lq *LinkQuery) WithName(name string)

func (*LinkQuery) WithTags

func (lq *LinkQuery) WithTags(tags ...string)

type ObjectRequestFunc

type ObjectRequestFunc func(requestProvider RequestProvider, query LinkQuery, typename string, id string, payload *easyjson.JSON, options *easyjson.JSON, timeout ...time.Duration) (map[string]*ObjectRequestReply, error)

type ObjectRequestReply

type ObjectRequestReply struct {
	ReqReply *easyjson.JSON
	ReqError error
}

type ObjectSignalFunc

type ObjectSignalFunc func(signalProvider SignalProvider, query LinkQuery, typename string, id string, payload *easyjson.JSON, options *easyjson.JSON) (map[string]error, error)

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)
	GetObjectImplTypes        func() (types []string, err error)
	ObjectMutexLock           func(objectId string, errorOnLocked bool) error
	ObjectMutexUnlock         func(objectId string) error
	Domain                    Domain
	Signal                    SFSignalFunc
	Request                   SFRequestFunc
	ObjectSignal              ObjectSignalFunc
	ObjectRequest             ObjectRequestFunc
	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