Version: v0.10.0 Latest Latest

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Plugin

type Plugin struct {
	Name    string   `json:"name"`
	Address string   `json:"address"`
	Methods []string `json:"methods"`

Plugin provides cancelable rpc server used to run custom plugins

func (*Plugin) Do

func (p *Plugin) Do(ctx context.Context, conductor string, rcvr interface{}) (err error)

Do register the plugin, send info to reproxy conductor and activate RPC listener. On completion unregister from reproxy. Blocking call, should run in goroutine on the caller side rvcr is provided struct implemented at least one RPC methods with the signature like this: func(req lib.Request, res *lib.Response) (err error) see [examples/plugin]() for more info

type Request

type Request struct {
	URL        string
	RemoteAddr string
	Host       string
	Header     http.Header
	Route      string // final destination
	Match      struct {
		Server         string
		Src            string
		Dst            string
		ProviderID     string
		PingURL        string
		MatchType      string
		AssetsLocation string
		AssetsWebRoot  string

Request sent to plugins

type Response

type Response struct {
	StatusCode         int
	HeadersIn          http.Header
	HeadersOut         http.Header
	OverrideHeadersIn  bool // indicates plugin removing all the original incoming headers
	OverrideHeadersOut bool // indicates plugin removing all the original outgoing headers

Response from plugin's handler call

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL