context

package
v4.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package context provide router context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithParams

func WithParams(ctx context.Context, params Params) context.Context

WithParams stores params in context

Types

type Param

type Param struct {
	Key   string
	Value string
}

Param object to hold request parameter

type Params

type Params []Param

Params slice returned from request context

func Parameters

func Parameters(ctx context.Context) (Params, bool)

Parameters extracts the request Params ctx, if present.

func (Params) Set added in v4.2.0

func (p Params) Set(index uint8, key string, value string)

Set key value pair at index

func (Params) Value

func (p Params) Value(key string) string

Value of the request parameter by name

Jump to

Keyboard shortcuts

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