pluginterfaces

package
v1.3.20 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 3 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Commmon interfaces used by github.com/IBM/go-security-plugs/rtplugs and the plgins it loads

Index

Constants

This section is empty.

Variables

View Source
var RoundTripPlugs []RoundTripPlug

Functions

func RegisterPlug

func RegisterPlug(p RoundTripPlug)

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

Types

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, c map[string]string, serviceName string, namespace string, logger Logger) context.Context
	Shutdown()
	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 {}

Jump to

Keyboard shortcuts

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