Documentation
¶
Overview ¶
Package server provides a pluggable SDK-compatible HTTP server.
The core Server is protocol-agnostic: it dispatches incoming requests to registered Handlers via a Matches predicate. Each Handler is a self-contained package (e.g. server/aws/s3, server/aws/dynamodb) that speaks its own wire format. Adding a new service — AWS EC2, Azure Blob, GCP GCS — is one new package and one Register call; the core server never changes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Matches(r *http.Request) bool
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
Handler is a self-contained protocol handler registered with a Server. Matches inspects the request and returns true if this handler should serve it; ServeHTTP writes the response. Handlers are evaluated in registration order, first match wins.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server routes incoming HTTP requests to registered Handlers. Server itself implements http.Handler, so httptest.NewServer(srv) works.
func New ¶
New creates a Server preloaded with the given handlers. Additional handlers can be added later via Register.
func (*Server) Register ¶
Register appends a handler. Handlers registered earlier take precedence, so register more specific handlers before catch-all ones.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aws assembles CloudEmu's AWS-compatible HTTP server.
|
Package aws assembles CloudEmu's AWS-compatible HTTP server. |
|
dynamodb
Package dynamodb implements the DynamoDB JSON-RPC protocol as a server.Handler.
|
Package dynamodb implements the DynamoDB JSON-RPC protocol as a server.Handler. |
|
s3
Package s3 implements the S3 REST+XML protocol as a server.Handler.
|
Package s3 implements the S3 REST+XML protocol as a server.Handler. |
|
Package wire provides shared HTTP wire-format helpers for service handlers: XML and JSON encoding, JSON decoding, and HTTP-date formatting.
|
Package wire provides shared HTTP wire-format helpers for service handlers: XML and JSON encoding, JSON decoding, and HTTP-date formatting. |