Documentation ¶
Overview ¶
Package uri implements OpenAPI path/query parameter encoding.
Index ¶
- func Clone(u *url.URL) *url.URL
- func NormalizeEscapedPath(s string) (string, bool)
- type Decoder
- type Encoder
- type Field
- type HeaderDecoder
- type HeaderEncoder
- type HeaderParameterDecodingConfig
- type HeaderParameterEncodingConfig
- type PathDecoder
- type PathDecoderConfig
- type PathEncoder
- type PathEncoderConfig
- type PathStyle
- type QueryDecoder
- type QueryEncoder
- type QueryParameterDecodingConfig
- type QueryParameterEncodingConfig
- type QueryParameterObjectField
- type QueryStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeEscapedPath ¶ added in v0.56.0
NormalizeEscapedPath normalizes escaped path.
All percent-encoded characters are upper-cased.
If the escaping
Types ¶
type HeaderDecoder ¶
type HeaderDecoder struct {
// contains filtered or unexported fields
}
func NewHeaderDecoder ¶
func NewHeaderDecoder(header http.Header) *HeaderDecoder
func (*HeaderDecoder) DecodeParam ¶ added in v0.33.0
func (d *HeaderDecoder) DecodeParam(cfg HeaderParameterDecodingConfig, f func(Decoder) error) error
func (*HeaderDecoder) HasParam ¶ added in v0.33.0
func (d *HeaderDecoder) HasParam(cfg HeaderParameterDecodingConfig) error
type HeaderEncoder ¶
type HeaderEncoder struct {
// contains filtered or unexported fields
}
func NewHeaderEncoder ¶
func NewHeaderEncoder(header http.Header) *HeaderEncoder
func (*HeaderEncoder) EncodeParam ¶ added in v0.33.0
func (e *HeaderEncoder) EncodeParam(cfg HeaderParameterEncodingConfig, f func(Encoder) error) error
func (*HeaderEncoder) Header ¶ added in v0.33.0
func (e *HeaderEncoder) Header() http.Header
type HeaderParameterDecodingConfig ¶ added in v0.33.0
type HeaderParameterEncodingConfig ¶ added in v0.33.0
type PathDecoder ¶
type PathDecoder struct {
// contains filtered or unexported fields
}
func NewPathDecoder ¶
func NewPathDecoder(cfg PathDecoderConfig) *PathDecoder
func (*PathDecoder) DecodeArray ¶
func (d *PathDecoder) DecodeArray(f func(d Decoder) error) error
func (*PathDecoder) DecodeFields ¶
func (d *PathDecoder) DecodeFields(f func(name string, d Decoder) error) error
func (*PathDecoder) DecodeValue ¶
func (d *PathDecoder) DecodeValue() (string, error)
type PathDecoderConfig ¶
type PathEncoder ¶
type PathEncoder struct {
// contains filtered or unexported fields
}
func NewPathEncoder ¶
func NewPathEncoder(cfg PathEncoderConfig) *PathEncoder
func (PathEncoder) EncodeArray ¶
func (PathEncoder) EncodeField ¶
func (PathEncoder) EncodeValue ¶
func (*PathEncoder) Result ¶
func (e *PathEncoder) Result() (r string)
type PathEncoderConfig ¶
type QueryDecoder ¶
type QueryDecoder struct {
// contains filtered or unexported fields
}
func NewQueryDecoder ¶
func NewQueryDecoder(values url.Values) *QueryDecoder
func (*QueryDecoder) DecodeParam ¶ added in v0.30.2
func (d *QueryDecoder) DecodeParam(cfg QueryParameterDecodingConfig, f func(Decoder) error) error
func (*QueryDecoder) HasParam ¶ added in v0.30.2
func (d *QueryDecoder) HasParam(cfg QueryParameterDecodingConfig) error
type QueryEncoder ¶
type QueryEncoder struct {
// contains filtered or unexported fields
}
func NewQueryEncoder ¶
func NewQueryEncoder() *QueryEncoder
func (*QueryEncoder) EncodeParam ¶ added in v0.30.2
func (e *QueryEncoder) EncodeParam(cfg QueryParameterEncodingConfig, f func(Encoder) error) error
func (*QueryEncoder) Values ¶ added in v0.30.2
func (e *QueryEncoder) Values() url.Values
func (*QueryEncoder) WriteMultipart ¶ added in v0.34.0
func (e *QueryEncoder) WriteMultipart(w *multipart.Writer) error
type QueryParameterDecodingConfig ¶ added in v0.30.2
type QueryParameterDecodingConfig struct { Name string Style QueryStyle Explode bool Fields []QueryParameterObjectField // Only for object param. }
type QueryParameterEncodingConfig ¶ added in v0.30.2
type QueryParameterEncodingConfig struct { Name string Style QueryStyle Explode bool }
type QueryParameterObjectField ¶ added in v0.30.2
type QueryStyle ¶
type QueryStyle string
const ( QueryStyleForm QueryStyle = "form" QueryStyleSpaceDelimited QueryStyle = "spaceDelimited" QueryStylePipeDelimited QueryStyle = "pipeDelimited" QueryStyleDeepObject QueryStyle = "deepObject" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.