Documentation ¶
Overview ¶
Package uri implements OpenAPI path/query parameter encoding.
Index ¶
- func AddPathParts(u *url.URL, parts ...string)
- func Clone(u *url.URL) *url.URL
- func NormalizeEscapedPath(s string) (string, bool)
- type CookieDecoder
- type CookieEncoder
- type CookieParameterDecodingConfig
- type CookieParameterEncodingConfig
- 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 AddPathParts ¶
AddPathParts adds escaped path parts to the given URL.
func NormalizeEscapedPath ¶
NormalizeEscapedPath normalizes escaped path.
All percent-encoded characters are upper-cased. If s contains unnecessarily escaped characters, they are unescaped.
If s contains invalid escape sequence, it returns empty string and false.
Types ¶
type CookieDecoder ¶
type CookieDecoder struct {
// contains filtered or unexported fields
}
func NewCookieDecoder ¶
func NewCookieDecoder(req *http.Request) *CookieDecoder
func (*CookieDecoder) DecodeParam ¶
func (d *CookieDecoder) DecodeParam(cfg CookieParameterDecodingConfig, f func(Decoder) error) error
func (*CookieDecoder) HasParam ¶
func (d *CookieDecoder) HasParam(cfg CookieParameterDecodingConfig) error
type CookieEncoder ¶
type CookieEncoder struct {
// contains filtered or unexported fields
}
func NewCookieEncoder ¶
func NewCookieEncoder(req *http.Request) *CookieEncoder
func (*CookieEncoder) EncodeParam ¶
func (e *CookieEncoder) EncodeParam(cfg CookieParameterEncodingConfig, f func(Encoder) error) error
type HeaderDecoder ¶
type HeaderDecoder struct {
// contains filtered or unexported fields
}
func NewHeaderDecoder ¶
func NewHeaderDecoder(header http.Header) *HeaderDecoder
func (*HeaderDecoder) DecodeParam ¶
func (d *HeaderDecoder) DecodeParam(cfg HeaderParameterDecodingConfig, f func(Decoder) error) error
func (*HeaderDecoder) HasParam ¶
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 ¶
func (e *HeaderEncoder) EncodeParam(cfg HeaderParameterEncodingConfig, f func(Encoder) error) error
func (*HeaderEncoder) Header ¶
func (e *HeaderEncoder) Header() http.Header
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, _ error)
type PathEncoderConfig ¶
type QueryDecoder ¶
type QueryDecoder struct {
// contains filtered or unexported fields
}
func NewQueryDecoder ¶
func NewQueryDecoder(values url.Values) *QueryDecoder
func (*QueryDecoder) DecodeParam ¶
func (d *QueryDecoder) DecodeParam(cfg QueryParameterDecodingConfig, f func(Decoder) error) error
func (*QueryDecoder) HasParam ¶
func (d *QueryDecoder) HasParam(cfg QueryParameterDecodingConfig) error
type QueryEncoder ¶
type QueryEncoder struct {
// contains filtered or unexported fields
}
func NewFormEncoder ¶
func NewFormEncoder(ct map[string]string) *QueryEncoder
func NewQueryEncoder ¶
func NewQueryEncoder() *QueryEncoder
func (*QueryEncoder) EncodeParam ¶
func (e *QueryEncoder) EncodeParam(cfg QueryParameterEncodingConfig, f func(Encoder) error) error
func (*QueryEncoder) Values ¶
func (e *QueryEncoder) Values() url.Values
func (*QueryEncoder) WriteMultipart ¶
func (e *QueryEncoder) WriteMultipart(w *multipart.Writer) error
type QueryParameterDecodingConfig ¶
type QueryParameterDecodingConfig struct { Name string Style QueryStyle Explode bool Fields []QueryParameterObjectField // Only for object param. }
type QueryParameterEncodingConfig ¶
type QueryParameterEncodingConfig struct { Name string Style QueryStyle Explode bool }
type QueryStyle ¶
type QueryStyle string
const ( QueryStyleForm QueryStyle = "form" QueryStyleSpaceDelimited QueryStyle = "spaceDelimited" QueryStylePipeDelimited QueryStyle = "pipeDelimited" QueryStyleDeepObject QueryStyle = "deepObject" )
Source Files ¶
- constval.go
- cookie_decoder.go
- cookie_encoder.go
- cookie_escape.go
- cookie_param_decoder.go
- cookie_param_encoder.go
- cursor.go
- doc.go
- header_decoder.go
- header_encoder.go
- header_param_decoder.go
- header_param_encoder.go
- interface.go
- normalize.go
- object.go
- path_decoder.go
- path_encoder.go
- query_decoder.go
- query_encoder.go
- query_param_decoder.go
- query_param_encoder.go
- receiver.go
- url.go
Click to show internal directories.
Click to hide internal directories.