plugins

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugins []Plugin

Plugins all plugins that this gateway have and can set to proxies

Functions

func GetMiddleware

func GetMiddleware(pluginName string) func(config map[string]interface{}) func(handler http.Handler) http.Handler

GetMiddleware use in SyncMiddleware for proxy after load of db

func RegisterPlugins

func RegisterPlugins()

RegisterPlugins for add plugs to Plugins

Types

type Plugin

type Plugin struct {
	Name       string
	Active     bool
	Config     map[string]interface{}
	Middleware func(config map[string]interface{}) func(handler http.Handler) http.Handler `json:"-"`
}

Plugin simple struct for plugins that define for service

func AddPluginProxy

func AddPluginProxy(name string, active bool, conf map[string]interface{}) (Plugin, bool)

AddPluginProxy to find and set plugin to proxy by costumer bool means error

func (Plugin) SetUPPlugin

func (p Plugin) SetUPPlugin() bool

SetUPPlugin to add plugin fro creator to plugin list return error if true mean that error happened

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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