awsquery

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package awsquery implements the AWS Query protocol: form-encoded requests carrying an Action parameter, XML responses in a per-action envelope. STS and SNS speak it exclusively; SQS speaks it for legacy (pre-2023 SDK) clients.

The response envelope is uniform across Query services:

<{Action}Response xmlns="...">
  <{Action}Result> ... </{Action}Result>      (omitted for result-less actions)
  <ResponseMetadata><RequestId>..</RequestId></ResponseMetadata>
</{Action}Response>

and so is the error envelope:

<ErrorResponse xmlns="...">
  <Error><Type>Sender</Type><Code>..</Code><Message>..</Message></Error>
  <RequestId>..</RequestId>
</ErrorResponse>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Members

func Members(vals url.Values, prefix string, memberless bool) []string

Members collects the values of a numbered-list parameter in order: prefix.member.1, prefix.member.2, ... (the `member` level is what most Query APIs use; pass memberless=true for APIs that number directly: prefix.1, ...).

func Params

func Params(r *http.Request) (url.Values, error)

Params merges the URL query and the form-encoded body into one set of parameters, the way AWS Query services accept them (GET with query params or POST with an x-www-form-urlencoded body).

Types

type API

type API struct {
	XMLNS string
}

API renders responses for one Query service (its xmlns is per-service).

func (API) WriteError

func (a API) WriteError(w http.ResponseWriter, e *awshttp.APIError)

WriteError writes the standard Query error envelope with e's HTTP status.

func (API) WriteResult

func (a API) WriteResult(w http.ResponseWriter, action string, result any)

WriteResult writes the standard success envelope. result must be a struct whose fields marshal into the {Action}Result element's children; pass nil for actions that have no result element.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL