shared

package
v0.0.0-...-f3e4cf9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "STATIC_PLUGIN",
	MagicCookieValue: "static-website-content",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	"handler": &HandlerPlugin{},
}

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Serve(r PluginQuery, w *PluginReply) error
	SetConfig(cfg map[string][]string, ok *bool) error
}

type HandlerPlugin

type HandlerPlugin struct {
	Impl Handler
}

func (HandlerPlugin) Client

func (HandlerPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*HandlerPlugin) Server

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

type HandlerRPC

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

func (*HandlerRPC) Serve

func (g *HandlerRPC) Serve(q PluginQuery) (*PluginReply, error)

func (*HandlerRPC) SetConfig

func (g *HandlerRPC) SetConfig(cfg map[string][]string) (bool, error)

type HandlerRPCServer

type HandlerRPCServer struct {
	Impl Handler
}

func (*HandlerRPCServer) Serve

func (s *HandlerRPCServer) Serve(r PluginQuery, reply *PluginReply) error

func (*HandlerRPCServer) SetConfig

func (s *HandlerRPCServer) SetConfig(cfg map[string][]string, ok *bool) error

type PluginQuery

type PluginQuery struct {
	Method           string
	URL              *url.URL
	Proto            string
	Host             string
	Header           http.Header
	RemoteAddr       string
	TransferEncoding []string
	RequestURI       string
	Body             []byte
}

func CreatePluginQuery

func CreatePluginQuery(r *http.Request) PluginQuery

type PluginReply

type PluginReply struct {
	Done   bool
	Status int
	Header http.Header
	Body   []byte
}

func (*PluginReply) Serve

Jump to

Keyboard shortcuts

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