shared

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModulePlugin

type ModulePlugin struct {
	Impl ModuleProvider
}

ModulePlugin is a representation of a plugin

func (*ModulePlugin) Client

func (*ModulePlugin) Client(_ *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client provides the client part of the plugin connection

func (*ModulePlugin) Server

func (p *ModulePlugin) Server(*plugin.MuxBroker) (interface{}, error)

Server provides the server part of the plugin connection

type ModuleProvider

type ModuleProvider interface {
	GetName() string
	GetVersion() modules.Version
	TickFunction() []PluginMessage
	GetComponents() []modules.Component
	GetComponentFile(path string) []byte
}

ModuleProvider serves as the interface plugins need to implement to be used as a module in Excubitor.

type ModuleRPC

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

ModuleRPC is the client of the plugin connection. Its methods are run in the main program to call the respective methods on the plugin side.

func (*ModuleRPC) GetComponentFile

func (rpc *ModuleRPC) GetComponentFile(path string) []byte

func (*ModuleRPC) GetComponents

func (rpc *ModuleRPC) GetComponents() []modules.Component

func (*ModuleRPC) GetName

func (rpc *ModuleRPC) GetName() string

func (*ModuleRPC) GetVersion

func (rpc *ModuleRPC) GetVersion() modules.Version

func (*ModuleRPC) TickFunction

func (rpc *ModuleRPC) TickFunction() []PluginMessage

type ModuleRPCServer

type ModuleRPCServer struct {
	Impl ModuleProvider
}

ModuleRPCServer is the server of the plugin connection. Its methods are run on the plugin side and called through ModuleRPC in the main program.

func (*ModuleRPCServer) GetComponentFile

func (s *ModuleRPCServer) GetComponentFile(args PathArgs, response *[]byte) error

func (*ModuleRPCServer) GetComponents

func (s *ModuleRPCServer) GetComponents(_ interface{}, response *[]modules.Component) error

func (*ModuleRPCServer) GetName

func (s *ModuleRPCServer) GetName(_ interface{}, response *string) error

func (*ModuleRPCServer) GetVersion

func (s *ModuleRPCServer) GetVersion(_ interface{}, response *modules.Version) error

func (*ModuleRPCServer) TickFunction

func (s *ModuleRPCServer) TickFunction(_ interface{}, response *[]PluginMessage) error

type PathArgs

type PathArgs struct {
	Path string
}

PathArgs serves as argument for the GetComponentFile method in the RPC Server

type PluginMessage

type PluginMessage struct {
	Monitor string
	Body    string
}

PluginMessage is a model of a message a plugin may send to the main application when ticked.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL