middleware

package
v0.0.0-...-1397d36 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CustResLogDataKey = "CustResLogData"

CustResLogDataKey is the key to be used in session data store to put any custom response log data.

Variables

This section is empty.

Functions

func CertAtuh

func CertAtuh(ctx *neptulon.ReqCtx) error

CertAtuh is TLS client-certificate authentication. If successful, certificate common name will stored with the key "userid" in session. If unsuccessful, connection will be closed right away.

func Echo

func Echo(ctx *neptulon.ReqCtx) error

Echo sends incoming messages back as is.

func Error

func Error(ctx *neptulon.ReqCtx) error

Error is an error/panic handler middleware. Any error/panic is recovered and logged and the error response is returned to the user (auto-generated if none was set).

func Logger

func Logger(ctx *neptulon.ReqCtx) error

Logger is an incoming/outgoing message logger with an optional prefix.

func LoggerWithPrefix

func LoggerWithPrefix(prefix string) func(ctx *neptulon.ReqCtx) error

LoggerWithPrefix appends given prefix to log strings.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is a request routing middleware.

func NewRouter

func NewRouter() *Router

NewRouter creates a new router instance.

func (*Router) Middleware

func (r *Router) Middleware(ctx *neptulon.ReqCtx) error

Middleware is the Neptulon middleware method.

func (*Router) Request

func (r *Router) Request(route string, handler func(ctx *neptulon.ReqCtx) error)

Request adds a new request route registry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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