plugin

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package plugin provides tools for loading and registering proxy plugins

Index

Constants

View Source
const (
	Namespace = "github.com/starvn/turbo/proxy/plugin"
)

Variables

This section is empty.

Functions

func LoadModifiers

func LoadModifiers(path, pattern string, rmf RegisterModifierFunc) (int, error)

func LoadModifiersWithLogger

func LoadModifiersWithLogger(path, pattern string, rmf RegisterModifierFunc, logger log.Logger) (int, error)

func RegisterModifier

func RegisterModifier(
	name string,
	modifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error),
	appliesToRequest bool,
	appliesToResponse bool,
)

Types

type LoggerRegisterer

type LoggerRegisterer interface {
	RegisterLogger(interface{})
}

type ModifierFactory

type ModifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error)

func GetRequestModifier

func GetRequestModifier(name string) (ModifierFactory, bool)

func GetResponseModifier

func GetResponseModifier(name string) (ModifierFactory, bool)

type Plugin

type Plugin interface {
	Lookup(name string) (plugin.Symbol, error)
}

type RegisterModifierFunc

type RegisterModifierFunc func(
	name string,
	modifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error),
	appliesToRequest bool,
	appliesToResponse bool,
)

type Registerer

type Registerer interface {
	RegisterModifiers(func(
		name string,
		modifierFactory func(map[string]interface{}) func(interface{}) (interface{}, error),
		appliesToRequest bool,
		appliesToResponse bool,
	))
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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