query

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchKey = errors.New("no such key")

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(query *headers.Headers) Query

func (*Query) Get

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

Get is responsible for getting a key from 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