qstring

package
v0.0.0-...-4f625b6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) (url.Values, error)

Marshal marshals the provided struct into a url.Values collection

func MarshalString

func MarshalString(v interface{}) (string, error)

Marshal marshals the provided struct into a raw query string and returns a conditional error

Types

type ComparativeTime

type ComparativeTime struct {
	Operator string
	Time     time.Time
}

ComparativeTime is a field that can be used for specifying a query parameter which includes a conditional operator and a timestamp

func NewComparativeTime

func NewComparativeTime() *ComparativeTime

NewComparativeTime returns a new ComparativeTime instance with a default operator of "="

func (*ComparativeTime) Parse

func (c *ComparativeTime) Parse(query string) error

Parse is used to parse a query string into a ComparativeTime instance

func (ComparativeTime) String

func (c ComparativeTime) String() string

String returns this ComparativeTime instance in the form of the query parameter that it came in on

type InvalidMarshalError

type InvalidMarshalError struct {
	Type reflect.Type
}

An InvalidMarshalError describes an invalid argument passed to Marshal or MarshalValue. (The argument to Marshal must be a non-nil pointer.)

func (InvalidMarshalError) Error

func (e InvalidMarshalError) Error() string

type Marshaller

type Marshaller interface {
	MarshalQuery() (url.Values, error)
}

Marshaller defines the interface for performing custom marshalling of struct values into query strings

Jump to

Keyboard shortcuts

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