url

package
v1.4.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchKey = errors.New("requested key is not presented")

Functions

This section is empty.

Types

type Query

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

Query is optional, it may contain rawQuery, but it will not be parsed until needed

func NewQuery

func NewQuery(queryFactory queryFactory) Query

func (*Query) Get

func (q *Query) Get(key string) (value []byte, err error)

Get is responsible for getting a key from url query. In case this method is called a first time since rawQuery was set (or not set at all), rawQuery bytearray will be parsed and value returned (or ErrNoSuchKey instead). In case of invalid query bytearray, ErrBadQuery will be returned

func (Query) Raw

func (q Query) Raw() []byte

Raw just returns a raw value of query as it is

func (*Query) Set

func (q *Query) Set(raw []byte)

Set is responsible for setting a raw value of query. Each call resets parsedQuery value to nil (query bytearray must be parsed again)

Jump to

Keyboard shortcuts

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