Documentation
¶
Overview ¶
Package modtool holds conversions between AutoFlow values and the pieces of an HTTP request and response, shared by the built-in modules that call an API.
Index ¶
- func HeaderValue(h http.Header) *pkg_autoflow.Value
- func RequestHeader(v *pkg_autoflow.Value) (http.Header, error)
- func RequestQuery(v *pkg_autoflow.Value) (url.Values, error)
- func ScalarText[T ~string | ~[]byte](v *pkg_autoflow.Value) (T, error)
- func StringValue(v *pkg_autoflow.Value) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeaderValue ¶
func HeaderValue(h http.Header) *pkg_autoflow.Value
HeaderValue renders response headers as a dict of header name to list of values.
func RequestHeader ¶
func RequestHeader(v *pkg_autoflow.Value) (http.Header, error)
RequestHeader converts a dict value, whose values are each a single element or a list of elements, into request headers. Header names are canonicalized, so several dict keys can map to the same name; their values are merged in the order the keys appear in the dict.
A nil value yields nil headers: that is what an absent or None argument binds to, so a caller does not have to check for one.
func RequestQuery ¶
func RequestQuery(v *pkg_autoflow.Value) (url.Values, error)
RequestQuery converts a dict value, whose values are each a single element or a list of elements, into URL query parameters.
A nil value yields nil query parameters: that is what an absent or None argument binds to, so a caller does not have to check for one.
func ScalarText ¶
func ScalarText[T ~string | ~[]byte](v *pkg_autoflow.Value) (T, error)
ScalarText extracts the text of a value, which must be a (sensitive) string or (sensitive) bytes.
func StringValue ¶
func StringValue(v *pkg_autoflow.Value) (string, bool)
StringValue extracts the text of a string value.
Types ¶
This section is empty.