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.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aws assembles CloudEmu's AWS-compatible HTTP server.
|
Package aws assembles CloudEmu's AWS-compatible HTTP server. |
|
cloudwatch
Package cloudwatch implements AWS CloudWatch's Smithy RPC-v2-CBOR protocol as a server.Handler.
|
Package cloudwatch implements AWS CloudWatch's Smithy RPC-v2-CBOR protocol as a server.Handler. |
|
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. |
|
ec2
Package ec2 implements the AWS EC2 query-protocol as a server.Handler.
|
Package ec2 implements the AWS EC2 query-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 azure assembles CloudEmu's Azure-compatible HTTP server.
|
Package azure assembles CloudEmu's Azure-compatible HTTP server. |
|
blob
Package blob implements the Azure Blob Storage REST+XML wire protocol as a server.Handler.
|
Package blob implements the Azure Blob Storage REST+XML wire protocol as a server.Handler. |
|
cosmos
Package cosmos implements the Azure Cosmos DB SQL data-plane REST API against a CloudEmu database driver.
|
Package cosmos implements the Azure Cosmos DB SQL data-plane REST API against a CloudEmu database driver. |
|
disks
Package disks serves Azure ARM Microsoft.Compute/disks requests against a CloudEmu compute driver's volume operations.
|
Package disks serves Azure ARM Microsoft.Compute/disks requests against a CloudEmu compute driver's volume operations. |
|
images
Package images serves Azure ARM Microsoft.Compute/images requests.
|
Package images serves Azure ARM Microsoft.Compute/images requests. |
|
monitor
Package monitor implements the Azure microsoft.insights metric-alerts resource against a CloudEmu monitoring driver.
|
Package monitor implements the Azure microsoft.insights metric-alerts resource against a CloudEmu monitoring driver. |
|
network
Package network implements the Microsoft.Network ARM resources we expose: virtualNetworks, subnets (nested), and networkSecurityGroups.
|
Package network implements the Microsoft.Network ARM resources we expose: virtualNetworks, subnets (nested), and networkSecurityGroups. |
|
snapshots
Package snapshots serves Azure ARM Microsoft.Compute/snapshots requests.
|
Package snapshots serves Azure ARM Microsoft.Compute/snapshots requests. |
|
sshpublickeys
Package sshpublickeys serves Azure ARM Microsoft.Compute/sshPublicKeys requests against the underlying compute driver's KeyPair operations.
|
Package sshpublickeys serves Azure ARM Microsoft.Compute/sshPublicKeys requests against the underlying compute driver's KeyPair operations. |
|
virtualmachines
Package virtualmachines serves Azure ARM Microsoft.Compute/virtualMachines requests against a CloudEmu compute driver.
|
Package virtualmachines serves Azure ARM Microsoft.Compute/virtualMachines requests against a CloudEmu compute driver. |
|
Package gcp assembles CloudEmu's GCP-compatible HTTP server.
|
Package gcp assembles CloudEmu's GCP-compatible HTTP server. |
|
compute
Package compute serves GCP Compute Engine REST API requests against a CloudEmu compute driver.
|
Package compute serves GCP Compute Engine REST API requests against a CloudEmu compute driver. |
|
firestore
Package firestore implements the GCP Firestore REST API as a server.Handler.
|
Package firestore implements the GCP Firestore REST API as a server.Handler. |
|
gcs
Package gcs implements the Google Cloud Storage JSON REST API as a server.Handler.
|
Package gcs implements the Google Cloud Storage JSON REST API as a server.Handler. |
|
monitoring
Package monitoring implements the GCP Cloud Monitoring REST API surface for alert policies.
|
Package monitoring implements the GCP Cloud Monitoring REST API surface for alert policies. |
|
networks
Package networks implements the GCP Compute Engine networking REST API (networks, subnetworks, firewalls) against a CloudEmu networking driver.
|
Package networks implements the GCP Compute Engine networking REST API (networks, subnetworks, firewalls) against a CloudEmu networking driver. |
|
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. |
|
awsquery
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. |
|
azurearm
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. |
|
gcprest
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. |