Documentation ¶
Index ¶
- Constants
- func Marshal(data interface{}) ([]byte, error)
- func NewEncoder(opts ...Option) *encoder
- func NewParser(opts ...Option) *parser
- func SetGlobalQueryEncoder(u QueryEncoder)
- func Unmarshal(data []byte, v interface{}) error
- type DefaultQueryEncoder
- type ErrInvalidMapKeyType
- type ErrInvalidMapValueType
- type ErrInvalidUnmarshalError
- type ErrTranslated
- type ErrUnhandledType
- type ErrUnsupportedBitSize
- type Option
- type QueryEncoder
Constants ¶
const ( // SymbolEqual is key character of querystring SymbolEqual = "=" // SymbolAnd is key character of querystring SymbolAnd = "&" )
Variables ¶
This section is empty.
Functions ¶
func NewEncoder ¶
func NewEncoder(opts ...Option) *encoder
NewEncoder return new encoder object do some option initialization
func NewParser ¶
func NewParser(opts ...Option) *parser
NewParser make a new parser object do some option initialization
func SetGlobalQueryEncoder ¶ added in v1.2.5
func SetGlobalQueryEncoder(u QueryEncoder)
SetGlobalQueryEncoder set global query encoder
Types ¶
type DefaultQueryEncoder ¶ added in v1.2.5
type DefaultQueryEncoder struct{}
A DefaultQueryEncoder is a default URL-Encoder
func (DefaultQueryEncoder) Escape ¶ added in v1.2.5
func (u DefaultQueryEncoder) Escape(s string) string
Escape text
type ErrInvalidMapKeyType ¶
type ErrInvalidMapKeyType struct {
// contains filtered or unexported fields
}
An ErrInvalidMapKeyType is a customized error
func (ErrInvalidMapKeyType) Error ¶
func (e ErrInvalidMapKeyType) Error() string
type ErrInvalidMapValueType ¶
type ErrInvalidMapValueType struct {
// contains filtered or unexported fields
}
An ErrInvalidMapValueType is a customized error
func (ErrInvalidMapValueType) Error ¶
func (e ErrInvalidMapValueType) Error() string
type ErrInvalidUnmarshalError ¶
type ErrInvalidUnmarshalError struct{}
An ErrInvalidUnmarshalError is a customized error
func (ErrInvalidUnmarshalError) Error ¶
func (e ErrInvalidUnmarshalError) Error() string
type ErrTranslated ¶
type ErrTranslated struct {
// contains filtered or unexported fields
}
An ErrTranslated is a customized error type
func (ErrTranslated) Error ¶
func (e ErrTranslated) Error() string
type ErrUnhandledType ¶
type ErrUnhandledType struct {
// contains filtered or unexported fields
}
An ErrUnhandledType is a customized error
func (ErrUnhandledType) Error ¶
func (e ErrUnhandledType) Error() string
type ErrUnsupportedBitSize ¶
type ErrUnsupportedBitSize struct {
// contains filtered or unexported fields
}
An ErrUnsupportedBitSize is a customized error
func (ErrUnsupportedBitSize) Error ¶
func (e ErrUnsupportedBitSize) Error() string
type Option ¶
type Option func(*options)
An Option is a func type for applying diff options
func WithNeedEmptyValue ¶
WithNeedEmptyValue is supposed to control whether to ignore zero value. It just happen to the element directly in structure, not including map slice array default:false, meaning ignore zero-value
func WithQueryEncoder ¶ added in v1.2.5
func WithQueryEncoder(u QueryEncoder) Option
WithQueryEncoder is supposed customized query encoder option