Version: v0.4.1 Latest Latest

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 4 Imported by: 0


Plug Interfaces

This base package defines teh interface and common data structures for security plugs including:

The plugs register with the package when loaded.




This section is empty.


This section is empty.


func RegisterPlug

func RegisterPlug(p RoundTripPlug)

RegisterPlug() is called from init() function of plugs


type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Sync() error

Any logger of this interface can be used by rtplugs and all connected plugs

var Log Logger

The logger for the rtplugs and all connected plugs

type RoundTripPlug

type RoundTripPlug interface {
	Init(ctx context.Context, config map[string]string, serviceName string, namespace string, logger Logger) context.Context
	PlugName() string
	PlugVersion() string
	ApproveRequest(*http.Request) (*http.Request, error)
	ApproveResponse(*http.Request, *http.Response) (*http.Response, error)

A plugin based on the newer RoundTripPlug supports offers this interface

The plugin will have a function

func NewPlug()  RoundTripPlug {}

func GetPlug

func GetPlug() RoundTripPlug

GetPlug() is called by implementations supporting a single plug

func GetPlugByName

func GetPlugByName(name string) RoundTripPlug

GetPlugByName() is called by implementatuions supporting multiple plugs

Jump to

Keyboard shortcuts

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