Documentation ¶
Index ¶
- type Plugo
- func (plugo *Plugo) Call(plugoId string, functionId string, arguments ...any) ([]any, error)
- func (plugo *Plugo) CallWithContext(plugoId, functionId string, ctx context.Context, arguments ...any) ([]any, error)
- func (plugo *Plugo) CallWithTimeout(plugoId string, functionId string, milliseconds int, arguments ...any) ([]any, error)
- func (plugo *Plugo) CheckConnection(connectedPlugoId string) bool
- func (plugo *Plugo) Expose(function any)
- func (plugo *Plugo) ExposeId(functionId string, function any)
- func (plugo *Plugo) Println(args ...any)
- func (plugo *Plugo) Ready(functionId string) error
- func (plugo *Plugo) Shutdown()
- func (plugo *Plugo) StartChildren(folderName string) error
- func (plugo *Plugo) Unexpose(functionId string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugo ¶
type Plugo struct { Id string ParentId string MemoryAllocation int // contains filtered or unexported fields }
func New ¶
This function creates a plugo. plugoId should be unique to avoid conflicts with other plugos.
func (*Plugo) CallWithContext ¶ added in v0.4.0
func (plugo *Plugo) CallWithContext( plugoId, functionId string, ctx context.Context, arguments ...any, ) ([]any, error)
This function attempts to call a function with Id functionId exposed by a plugo with Id plugoId with arguments.
func (*Plugo) CallWithTimeout ¶ added in v0.4.0
func (*Plugo) CheckConnection ¶ added in v0.4.0
func (*Plugo) Expose ¶
This function exposes the given function to connected plugos. If f is of type func(...any) []any it will be not be called using reflect, resulting in better performance. functionId is the Id through which other plugos may call the function using the plugo.Call() function.
func (*Plugo) ExposeId ¶ added in v0.6.1
Exposes the function just like Expose(), but uses the given Id.
func (*Plugo) Shutdown ¶ added in v0.2.0
func (plugo *Plugo) Shutdown()
This function gracefully shuts the plugo down. It stops listening for incoming connections and closes all existing connections.