ec2

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package ec2 implements the AWS EC2 query-protocol as a server.Handler. Point the real aws-sdk-go-v2 EC2 client at a Server registered with this handler and operations work against an in-memory compute driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves EC2 query-protocol requests. Real AWS EC2 serves both compute and VPC/networking on one endpoint, so the handler holds both drivers and dispatches based on the Action parameter.

func New

New returns an EC2 handler backed by c and v. Either may be nil if only one service is being emulated, though most workflows need both together.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches returns true for EC2-shaped requests. EC2 uses the AWS query protocol: either a POST with form-encoded body (the SDK default) or a GET with ?Action=... on the URL. It never sets X-Amz-Target; that's reserved for JSON-RPC services like DynamoDB.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP parses the request form and dispatches on Action.

Jump to

Keyboard shortcuts

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