core

package
v0.0.0-...-591f1e8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "CORE_PLUGIN",
	MagicCookieValue: "RICH",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	"core": &ProcessPlugin{},
}

Functions

This section is empty.

Types

type Process

type Process struct {
}

func (*Process) Process

func (p *Process) Process(req []byte) ([]byte, error)

type ProcessClient

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

func (*ProcessClient) Process

func (p *ProcessClient) Process(req []byte) ([]byte, error)

type ProcessPlugin

type ProcessPlugin struct {
	plugin.Plugin
	Impl Processer
}

func (*ProcessPlugin) GRPCClient

func (p *ProcessPlugin) GRPCClient(ctx context.Context, b *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient should return the interface implementation for the plugin you're serving via gRPC. The provided context will be canceled by go-plugin in the event of the plugin process exiting.

func (*ProcessPlugin) GRPCServer

func (p *ProcessPlugin) GRPCServer(b *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer should register this plugin for serving with the given GRPCServer. Unlike Plugin.Server, this is only called once since gRPC plugins serve singletons.

type ProcessServer

type ProcessServer struct {
	Impl Processer
}

func (*ProcessServer) Process

func (p *ProcessServer) Process(ctx context.Context, req *core.Request) (*core.Response, error)

type Processer

type Processer interface {
	Process(request []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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