wire

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package wire provides shared HTTP wire-format helpers for service handlers: XML and JSON encoding, JSON decoding, and HTTP-date formatting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(w http.ResponseWriter, r *http.Request, v any) bool

DecodeJSON reads a JSON request body into v. Returns false and writes an error response if decoding fails.

func ToHTTPDate

func ToHTTPDate(iso string) string

ToHTTPDate converts an ISO8601 timestamp to HTTP-date format (RFC1123). The AWS SDK expects Last-Modified as "Mon, 02 Jan 2006 15:04:05 GMT".

func WriteJSON

func WriteJSON(w http.ResponseWriter, v any)

WriteJSON writes a JSON response with a 200 status code.

func WriteJSONError

func WriteJSONError(w http.ResponseWriter, status int, errType, msg string)

WriteJSONError writes a JSON error response with the given status.

func WriteXML

func WriteXML(w http.ResponseWriter, status int, v any)

WriteXML writes an XML response with the given status code.

Types

This section is empty.

Directories

Path Synopsis
Package awsquery provides parsers and encoders for the AWS query-protocol wire format used by EC2, Auto-Scaling, STS, and several other services.
Package awsquery provides parsers and encoders for the AWS query-protocol wire format used by EC2, Auto-Scaling, STS, and several other services.
Package azurearm provides shared HTTP wire-format helpers for Azure Resource Manager (ARM) JSON REST handlers.
Package azurearm provides shared HTTP wire-format helpers for Azure Resource Manager (ARM) JSON REST handlers.
Package gcprest provides shared HTTP wire-format helpers for GCP Compute (and other GCP REST APIs) JSON handlers.
Package gcprest provides shared HTTP wire-format helpers for GCP Compute (and other GCP REST APIs) JSON handlers.

Jump to

Keyboard shortcuts

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