middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(ctx *context.Context) error

Action is a function that takes a context and returns an error.

func ErrHandler

func ErrHandler(action Action) Action

ErrHandler handles an action error

func Log

func Log(title string, next Action, padding Padding) Action

Log pretty prints the given action and its title.

type Padding

type Padding int

Padding is a logging initial padding.

const DefaultInitialPadding Padding = 3

DefaultInitialPadding is the default padding in the log library.

const ExtraPadding Padding = DefaultInitialPadding * 2

ExtraPadding is the double of the DefaultInitialPadding.

Jump to

Keyboard shortcuts

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