ace

package
v0.0.0-...-71a9ee9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

ace is a elsa middleware for ace

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	Prefix    string `long:"ace_prefix" default:"/"             description:"URL prefix to handle"`
	Ext       string `long:"ace_ext"    default:".ace"          description:"Template extention"`
	Templates string `long:"ace_path"   default:"templates/ace" description:"Dir where templates are"`
	Error403  string `long:"ace_403"    default:".error403"     description:"Template for 403 error"`
	Error404  string `long:"ace_404"    default:".error404"     description:"Template for 404 error"`
}

Flags defines local application flags

type Middleware

type Middleware struct {
	Log    *log.Logger
	Config *Flags
	Tree   *dirtree.Tree
	IsLast bool // middleware is the last in chain, show errors and show 404 if no template
}

Middleware is a struct that has a ServeHTTP method

func New

func New(logger *log.Logger, cfg *Flags, show404 bool) *Middleware

func (*Middleware) ServeHTTP

func (mw *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

The middleware handler

Jump to

Keyboard shortcuts

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