chivalues

package module
v0.0.0-...-49ee6a2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package chivalues provides value extractor for Chi router.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoValue = errors.New("request path value is empty")

ErrNoValue indicates that all possible route path segments were empty.

Functions

This section is empty.

Types

type ChiRequestValueExtractor

type ChiRequestValueExtractor struct {
	// contains filtered or unexported fields
}

ChiRequestValueExtractor retrieves chi.Router named URL parameters.

func New

func New(names ...string) (*ChiRequestValueExtractor, error)

New creates a ChiRequestValueExtractor that retrieves named URL parameters seeded by a chi.Router.

func (*ChiRequestValueExtractor) ExtractRequestValue

func (c *ChiRequestValueExtractor) ExtractRequestValue(vs url.Values, r *http.Request) error

ExtractRequestValue populates [url.Value]s with URL parameters.

func (*ChiRequestValueExtractor) ExtractStringValue

func (c *ChiRequestValueExtractor) ExtractStringValue(r *http.Request) (string, error)

ExtractStringValue satisfies `extract.StringValue` interface.

Jump to

Keyboard shortcuts

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