action

package
v0.0.0-...-5a1941a Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package action provides functions for search of actions among methods of a package and checking whether they are actions with special meaning (such as Before or After) or just regular actions.

Index

Constants

View Source
const (
	// Interface is an interface that should be implemented
	// by types that are being returned from actions.
	Interface = "Handler"

	// InterfaceImport is a GOPATH to the Handler interface that should be
	// implemented by types being returned from actions.
	InterfaceImport = "net/http"

	// MethodBefore is a name of the magic method that will be executed
	// before every action.
	MethodBefore = "Before"

	// MethodAfter is a name of the magic method that will be executed
	// after every action.
	MethodAfter = "After"
)

Variables

View Source
var StrconvContext = strconv.Context()

StrconvContext is a mapping of supported by strconv types and reflect functions.

Functions

func After

func After(f *reflect.Func) bool

After gets an action Func and checks whether it is an After magic action.

func Before

func Before(f *reflect.Func) bool

Before gets an action Func and checks whether it is a Before magic action.

func Func

func Func(pkg *reflect.Package) func(f *reflect.Func) bool

Func returns a function that may be used to check whether specific Func represents an action (or one of magic method) or not. Returned function assumes it is getting functions with receivers as input parameter.

func Regular

func Regular(f *reflect.Func) bool

Regular gets an action Func and makes sure it is not a magic action but a usual one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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