plugins

package
v0.0.0-...-d7376be Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

plugins is package providing a number of common middleware plugins for the Verto framework. Currently included are plugins for compression handling, panic recovery, and CORS handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	// Verbose is flag to determine the verbosity
	// of a plugin
	Verbose bool

	// OnEnter is an optional callback to run each
	// time the plugin enters execution
	OnEnter func(c *verto.Context)

	// OnExit is an optional callback to run each
	// time the plugin exits execution
	OnExit func(c *verto.Context)

	// Id is an id for the plugin
	Id string
}

PluginCore represents core functionality for all Verto pre-built plugins

func (Core) Handle

func (core Core) Handle(
	f func(*verto.Context, http.HandlerFunc),
	c *verto.Context,
	next http.HandlerFunc)

Handle wraps a plugin function within Core plugin functionality. This allows the OnEnter and OnExit functions to run for the wrapped plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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