plug

package module
v0.0.0-...-94a2f9b Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "SAILOR_MAGIC_COOKIE",
	MagicCookieValue: "jkda2981dASA219",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	"hook": &SailorPlugin{},
}

Functions

This section is empty.

Types

type DeployRequest

type DeployRequest struct {
	Ns      string
	App     string
	Content []byte
}

type DeployResponse

type DeployResponse struct {
	Status DoneResponse
}

type DoneResponse

type DoneResponse struct {
	Ok      bool
	Message string
}

type HookRPCClient

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

func (*HookRPCClient) Health

func (hc *HookRPCClient) Health() DoneResponse

func (*HookRPCClient) OnDeploy

func (hc *HookRPCClient) OnDeploy(req DeployRequest) DeployResponse

type HookRPCServer

type HookRPCServer struct{ Impl SailorHook }

func (*HookRPCServer) Health

func (hs *HookRPCServer) Health(args any, resp *DoneResponse) error

func (*HookRPCServer) OnDeploy

func (hs *HookRPCServer) OnDeploy(args DeployRequest, resp *DeployResponse) error

type SailorHook

type SailorHook interface {
	Health() DoneResponse
	OnDeploy(req DeployRequest) DeployResponse
}

type SailorPlugin

type SailorPlugin struct {
	plugin.Plugin

	Impl SailorHook
}

func (*SailorPlugin) Client

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

Client returns an interface implementation for the plugin you're serving that communicates to the server end of the plugin.

func (*SailorPlugin) Server

func (sp *SailorPlugin) Server(_ *plugin.MuxBroker) (interface{}, error)

Server should return the RPC server compatible struct to serve the methods that the Client calls over net/rpc.

Directories

Path Synopsis
sdk module

Jump to

Keyboard shortcuts

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