Documentation ¶
Index ¶
- Constants
- func DecodeArbitraryXML(r io.Reader) (any, error)
- func EncodeQueryValues(qValues url.Values, allowReserved bool) string
- func EvalQueryParameterURL(q *url.Values, name string, encObject rest.EncodingObject, keys Keys, ...)
- func SetHeaderParameters(header *http.Header, param *rest.RequestParameter, queryParams ParameterItems)
- func StringifySimpleScalar(val reflect.Value, kind reflect.Kind) (string, error)
- func UnwrapNullableType(input schema.Type) (schema.TypeEncoder, bool, error)
- type DataURI
- type JSONDecoder
- type Key
- type Keys
- type MultipartFormEncoder
- type MultipartWriter
- type ParameterItem
- func (ssp *ParameterItem) Add(key Key, value string)
- func (ssp *ParameterItem) AddKey(key Key)
- func (ssp *ParameterItem) AddKeys(keys []Key)
- func (ssp *ParameterItem) AddValue(value string)
- func (ssp *ParameterItem) AddValues(values []string)
- func (ssp ParameterItem) Keys() Keys
- func (ssp *ParameterItem) PrependKey(key Key)
- func (ssp *ParameterItem) PrependKeys(keys []Key)
- func (ssp *ParameterItem) PrependValue(value string)
- func (ssp *ParameterItem) PrependValues(values []string)
- func (ssp ParameterItem) String() string
- func (ssp ParameterItem) Values() []string
- type ParameterItems
- type URLParameterEncoder
- func (c *URLParameterEncoder) Encode(bodyInfo *rest.ArgumentInfo, bodyData any) (io.ReadSeeker, int64, error)
- func (c *URLParameterEncoder) EncodeArbitrary(bodyData any) (io.ReadSeeker, int64, error)
- func (c *URLParameterEncoder) EncodeParameterValues(objectField *rest.ObjectField, reflectValue reflect.Value, fieldPaths []string) (ParameterItems, error)
- type XMLDecoder
- type XMLEncoder
Constants ¶
const ( // EncodingBase64 is base64 encoding for the data url EncodingBase64 = "base64" // EncodingASCII is ascii encoding for the data url EncodingASCII = "ascii" )
Variables ¶
This section is empty.
Functions ¶
func DecodeArbitraryXML ¶
DecodeArbitraryXML decodes an arbitrary XML from a reader stream.
func EncodeQueryValues ¶ added in v0.6.0
EncodeQueryValues encode query values to string.
func EvalQueryParameterURL ¶ added in v0.6.0
func EvalQueryParameterURL(q *url.Values, name string, encObject rest.EncodingObject, keys Keys, values []string)
EvalQueryParameterURL evaluate the query parameter URL
func SetHeaderParameters ¶ added in v0.6.0
func SetHeaderParameters(header *http.Header, param *rest.RequestParameter, queryParams ParameterItems)
SetHeaderParameters set parameters to request headers
func StringifySimpleScalar ¶
StringifySimpleScalar converts a simple scalar value to string.
func UnwrapNullableType ¶ added in v0.6.0
UnwrapNullableType unwraps the underlying type of the nullable type
Types ¶
type DataURI ¶
DataURI represents the Data URI scheme
func DecodeDataURI ¶
DecodeDataURI decodes data URI scheme data:[<media type>][;<key>=<value>][;<extension>],<data>
type JSONDecoder ¶ added in v0.6.0
type JSONDecoder struct {
// contains filtered or unexported fields
}
JSONDecoder implements a dynamic JSON decoder from the HTTP schema.
func NewJSONDecoder ¶ added in v0.6.0
func NewJSONDecoder(httpSchema *rest.NDCHttpSchema) *JSONDecoder
NewJSONDecoder creates a new JSON encoder.
type Key ¶ added in v0.6.0
type Key struct {
// contains filtered or unexported fields
}
Key represents a key string or index
type MultipartFormEncoder ¶ added in v0.6.0
type MultipartFormEncoder struct {
// contains filtered or unexported fields
}
MultipartFormEncoder implements a multipart/form encoder.
func NewMultipartFormEncoder ¶ added in v0.6.0
func NewMultipartFormEncoder(schema *rest.NDCHttpSchema, operation *rest.OperationInfo, arguments map[string]any) *MultipartFormEncoder
func (*MultipartFormEncoder) EncodeArbitrary ¶ added in v0.7.0
EncodeArbitrary encodes the unknown data to multipart/form.
type MultipartWriter ¶
MultipartWriter extends multipart.Writer with helpers
func NewMultipartWriter ¶
func NewMultipartWriter(w io.Writer) *MultipartWriter
NewMultipartWriter creates a MultipartWriter instance
func (*MultipartWriter) WriteDataURI ¶
WriteDataURI write a file from data URI string
func (*MultipartWriter) WriteField ¶
func (w *MultipartWriter) WriteField(fieldName, value string, headers http.Header) error
WriteField calls CreateFormField and then writes the given value.
type ParameterItem ¶ added in v0.6.0
type ParameterItem struct {
// contains filtered or unexported fields
}
ParameterItem represents the key-value slice pair
func NewParameterItem ¶ added in v0.6.0
func NewParameterItem(keys Keys, values []string) ParameterItem
NewParameterItem creates a parameter value pair
func (*ParameterItem) Add ¶ added in v0.6.0
func (ssp *ParameterItem) Add(key Key, value string)
func (*ParameterItem) AddKey ¶ added in v0.6.0
func (ssp *ParameterItem) AddKey(key Key)
func (*ParameterItem) AddKeys ¶ added in v0.6.0
func (ssp *ParameterItem) AddKeys(keys []Key)
func (*ParameterItem) AddValue ¶ added in v0.6.0
func (ssp *ParameterItem) AddValue(value string)
func (*ParameterItem) AddValues ¶ added in v0.6.0
func (ssp *ParameterItem) AddValues(values []string)
func (ParameterItem) Keys ¶ added in v0.6.0
func (ssp ParameterItem) Keys() Keys
Keys returns keys of the parameter item
func (*ParameterItem) PrependKey ¶ added in v0.6.0
func (ssp *ParameterItem) PrependKey(key Key)
func (*ParameterItem) PrependKeys ¶ added in v0.6.0
func (ssp *ParameterItem) PrependKeys(keys []Key)
func (*ParameterItem) PrependValue ¶ added in v0.6.0
func (ssp *ParameterItem) PrependValue(value string)
func (*ParameterItem) PrependValues ¶ added in v0.6.0
func (ssp *ParameterItem) PrependValues(values []string)
func (ParameterItem) String ¶ added in v0.6.0
func (ssp ParameterItem) String() string
String implements fmt.Stringer interface
func (ParameterItem) Values ¶ added in v0.6.0
func (ssp ParameterItem) Values() []string
type ParameterItems ¶ added in v0.6.0
type ParameterItems []ParameterItem
func (*ParameterItems) Add ¶ added in v0.6.0
func (ssp *ParameterItems) Add(keys []Key, values []string)
func (ParameterItems) Find ¶ added in v0.6.0
func (ssp ParameterItems) Find(keys []Key) *ParameterItem
func (ParameterItems) FindDefault ¶ added in v0.6.0
func (ssp ParameterItems) FindDefault() *ParameterItem
func (ParameterItems) FindIndex ¶ added in v0.6.0
func (ssp ParameterItems) FindIndex(keys []Key) int
func (ParameterItems) String ¶ added in v0.6.0
func (ssp ParameterItems) String() string
String implements fmt.Stringer interface
type URLParameterEncoder ¶ added in v0.6.0
type URLParameterEncoder struct {
// contains filtered or unexported fields
}
URLParameterEncoder represents a URL parameter encoder.
func NewURLParameterEncoder ¶ added in v0.6.0
func NewURLParameterEncoder(schema *rest.NDCHttpSchema, contentType string) *URLParameterEncoder
NewURLParameterEncoder creates a URLParameterEncoder instance.
func (*URLParameterEncoder) Encode ¶ added in v0.6.0
func (c *URLParameterEncoder) Encode(bodyInfo *rest.ArgumentInfo, bodyData any) (io.ReadSeeker, int64, error)
func (*URLParameterEncoder) EncodeArbitrary ¶ added in v0.7.0
func (c *URLParameterEncoder) EncodeArbitrary(bodyData any) (io.ReadSeeker, int64, error)
Encode marshals the arbitrary body to xml bytes.
func (*URLParameterEncoder) EncodeParameterValues ¶ added in v0.6.0
func (c *URLParameterEncoder) EncodeParameterValues(objectField *rest.ObjectField, reflectValue reflect.Value, fieldPaths []string) (ParameterItems, error)
type XMLDecoder ¶
type XMLDecoder struct {
// contains filtered or unexported fields
}
XMLDecoder implements a dynamic XML decoder from the HTTP schema.
func NewXMLDecoder ¶
func NewXMLDecoder(httpSchema *rest.NDCHttpSchema) *XMLDecoder
NewXMLDecoder creates a new XML encoder.
type XMLEncoder ¶
type XMLEncoder struct {
// contains filtered or unexported fields
}
XMLEncoder implements a dynamic XML encoder from the HTTP schema.
func NewXMLEncoder ¶
func NewXMLEncoder(httpSchema *rest.NDCHttpSchema) *XMLEncoder
NewXMLEncoder creates a new XML encoder.
func (*XMLEncoder) Encode ¶
func (c *XMLEncoder) Encode(bodyInfo *rest.ArgumentInfo, bodyData any) ([]byte, error)
Encode marshals the body to xml bytes.
func (*XMLEncoder) EncodeArbitrary ¶ added in v0.7.0
func (c *XMLEncoder) EncodeArbitrary(bodyData any) ([]byte, error)
Encode marshals the arbitrary body to xml bytes.