ctx

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ctx defines the context available for predicates, that is, the data about the incoming request or the result of the previous evaluated predicates

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	// Incoming request
	In *http.Request

	// Default predicates values, set by 'default' predicate
	Default Default

	// Variables set by the 'variable' option
	V Variables

	// Results registered by previous predicates, using the
	// 'register' option
	R Registered

	// Value of last evaluated predicate
	Result bool
}

Ctx is the main entry point to the context

func New

func New() *Ctx

New returns a empty context

type Default

type Default map[string]DefaultParams

Default stores predicates values, set by 'default' predicate

type DefaultParams

type DefaultParams map[string]interface{}

DefaultParams stores the default parameters for a predicate type

type Registered

type Registered map[string]Result

Registered stores results resgistered by a predicate

type Result

type Result map[string]interface{}

Result is the type data returned by predicates

type URL

type URL struct {
	Params url.Values // map[string]string
}

URL contains info about incoming URL

type Variables

type Variables map[string]interface{}

Variables set by the 'variable' option

Jump to

Keyboard shortcuts

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