query

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Generated by gen.go, DON NOT EDIT!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(q Query, key string, dft bool) (bool, error)

func Duration

func Duration(q Query, key string, dft time.Duration) (time.Duration, error)

func Float32

func Float32(q Query, key string, dft float32) (float32, error)

func Float64

func Float64(q Query, key string, dft float64) (float64, error)

func Int

func Int(q Query, key string, dft int) (int, error)

func Int16

func Int16(q Query, key string, dft int16) (int16, error)

func Int32

func Int32(q Query, key string, dft int32) (int32, error)

func Int64

func Int64(q Query, key string, dft int64) (int64, error)

func Int8

func Int8(q Query, key string, dft int8) (int8, error)

func JSON

func JSON(q Query, key string, ptr any) error

func ParseURL

func ParseURL(rawurl string, defaultScheme string) (*url.URL, error)

ParseURL parses rawurl as an url.URL with defaultScheme if scheme(like xxx://) not found in rawurl

func RequiredBool

func RequiredBool(q Query, key string) (bool, error)

func RequiredDuration

func RequiredDuration(q Query, key string) (time.Duration, error)

func RequiredFloat32

func RequiredFloat32(q Query, key string) (float32, error)

func RequiredFloat64

func RequiredFloat64(q Query, key string) (float64, error)

func RequiredInt

func RequiredInt(q Query, key string) (int, error)

func RequiredInt16

func RequiredInt16(q Query, key string) (int16, error)

func RequiredInt32

func RequiredInt32(q Query, key string) (int32, error)

func RequiredInt64

func RequiredInt64(q Query, key string) (int64, error)

func RequiredInt8

func RequiredInt8(q Query, key string) (int8, error)

func RequiredString

func RequiredString(q Query, key string) (string, error)

func RequiredUint

func RequiredUint(q Query, key string) (uint, error)

func RequiredUint16

func RequiredUint16(q Query, key string) (uint16, error)

func RequiredUint32

func RequiredUint32(q Query, key string) (uint32, error)

func RequiredUint64

func RequiredUint64(q Query, key string) (uint64, error)

func RequiredUint8

func RequiredUint8(q Query, key string) (uint8, error)

func String

func String(q Query, key string, dft string) string

func Uint

func Uint(q Query, key string, dft uint) (uint, error)

func Uint16

func Uint16(q Query, key string, dft uint16) (uint16, error)

func Uint32

func Uint32(q Query, key string, dft uint32) (uint32, error)

func Uint64

func Uint64(q Query, key string, dft uint64) (uint64, error)

func Uint8

func Uint8(q Query, key string, dft uint8) (uint8, error)

Types

type Parser

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

Parser used to parse arguments like url

func New

func New(q Query) *Parser

New creates a parser with a query object

func Parse

func Parse(rawquery string) *Parser

Parse creates a parser by parsing raw query string

func (*Parser) Bool

func (p *Parser) Bool(val *bool, key string, dft bool) *Parser

Bool parses argument

func (*Parser) Duration

func (p *Parser) Duration(val *time.Duration, key string, dft time.Duration) *Parser

Duration parses argument

func (*Parser) Err

func (p *Parser) Err() error

Err returns all errors while parsing arguments

func (*Parser) Float32

func (p *Parser) Float32(val *float32, key string, dft float32) *Parser

Float32 parses argument

func (*Parser) Float64

func (p *Parser) Float64(val *float64, key string, dft float64) *Parser

Float64 parses argument

func (*Parser) Int

func (p *Parser) Int(val *int, key string, dft int) *Parser

Int parses argument

func (*Parser) Int16

func (p *Parser) Int16(val *int16, key string, dft int16) *Parser

Int16 parses argument

func (*Parser) Int32

func (p *Parser) Int32(val *int32, key string, dft int32) *Parser

Int32 parses argument

func (*Parser) Int64

func (p *Parser) Int64(val *int64, key string, dft int64) *Parser

Int64 parses argument

func (*Parser) Int8

func (p *Parser) Int8(val *int8, key string, dft int8) *Parser

Int8 parses argument

func (*Parser) RequiredBool

func (p *Parser) RequiredBool(val *bool, key string) *Parser

RequiredBool parses required argument

func (*Parser) RequiredDuration

func (p *Parser) RequiredDuration(val *time.Duration, key string) *Parser

RequiredDuration parses required argument

func (*Parser) RequiredFloat32

func (p *Parser) RequiredFloat32(val *float32, key string) *Parser

RequiredFloat32 parses required argument

func (*Parser) RequiredFloat64

func (p *Parser) RequiredFloat64(val *float64, key string) *Parser

RequiredFloat64 parses required argument

func (*Parser) RequiredInt

func (p *Parser) RequiredInt(val *int, key string) *Parser

RequiredInt parses required argument

func (*Parser) RequiredInt16

func (p *Parser) RequiredInt16(val *int16, key string) *Parser

RequiredInt16 parses required argument

func (*Parser) RequiredInt32

func (p *Parser) RequiredInt32(val *int32, key string) *Parser

RequiredInt32 parses required argument

func (*Parser) RequiredInt64

func (p *Parser) RequiredInt64(val *int64, key string) *Parser

RequiredInt64 parses required argument

func (*Parser) RequiredInt8

func (p *Parser) RequiredInt8(val *int8, key string) *Parser

RequiredInt8 parses required argument

func (*Parser) RequiredString

func (p *Parser) RequiredString(val *string, key string) *Parser

RequiredString parses required argument

func (*Parser) RequiredUint

func (p *Parser) RequiredUint(val *uint, key string) *Parser

RequiredUint parses required argument

func (*Parser) RequiredUint16

func (p *Parser) RequiredUint16(val *uint16, key string) *Parser

RequiredUint16 parses required argument

func (*Parser) RequiredUint32

func (p *Parser) RequiredUint32(val *uint32, key string) *Parser

RequiredUint32 parses required argument

func (*Parser) RequiredUint64

func (p *Parser) RequiredUint64(val *uint64, key string) *Parser

RequiredUint64 parses required argument

func (*Parser) RequiredUint8

func (p *Parser) RequiredUint8(val *uint8, key string) *Parser

RequiredUint8 parses required argument

func (*Parser) String

func (p *Parser) String(val *string, key string, dft string) *Parser

String parses argument

func (*Parser) Uint

func (p *Parser) Uint(val *uint, key string, dft uint) *Parser

Uint parses argument

func (*Parser) Uint16

func (p *Parser) Uint16(val *uint16, key string, dft uint16) *Parser

Uint16 parses argument

func (*Parser) Uint32

func (p *Parser) Uint32(val *uint32, key string, dft uint32) *Parser

Uint32 parses argument

func (*Parser) Uint64

func (p *Parser) Uint64(val *uint64, key string, dft uint64) *Parser

Uint64 parses argument

func (*Parser) Uint8

func (p *Parser) Uint8(val *uint8, key string, dft uint8) *Parser

Uint8 parses argument

type Query

type Query = map[string][]string

Query alias map[string][]string

Jump to

Keyboard shortcuts

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