Documentation
¶
Index ¶
- Variables
- type Cluster
- type ClusterPolicy
- type CreateClusterInput
- type CreateStreamInput
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) CreateCluster(accountID, region string, in CreateClusterInput) (*Cluster, error)
- func (b *InMemoryBackend) CreateStream(clusterIdentifier string, in CreateStreamInput) (*Stream, error)
- func (b *InMemoryBackend) DeleteCluster(identifier string) (*Cluster, error)
- func (b *InMemoryBackend) DeleteClusterPolicy(identifier, expectedVersion string) (*ClusterPolicy, error)
- func (b *InMemoryBackend) DeleteStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
- func (b *InMemoryBackend) GetCluster(identifier string) (*Cluster, error)
- func (b *InMemoryBackend) GetClusterPolicy(identifier string) (*ClusterPolicy, error)
- func (b *InMemoryBackend) GetStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
- func (b *InMemoryBackend) GetVpcEndpointServiceName(identifier, region string) (string, string, error)
- func (b *InMemoryBackend) ListClusters(nextToken string, maxResults int) ([]*Cluster, string, error)
- func (b *InMemoryBackend) ListStreams(clusterIdentifier, nextToken string, maxResults int) ([]*Stream, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) PutClusterPolicy(identifier, policy, expectedVersion string) (*ClusterPolicy, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateCluster(identifier string, in UpdateClusterInput) (*Cluster, error)
- type MultiRegionProperties
- type Provider
- type Snapshottable
- type StorageBackend
- type Stream
- type StreamTarget
- type UpdateClusterInput
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClusterNotFound is returned when a cluster identifier does not exist. ErrClusterNotFound = awserr.New("cluster not found", awserr.ErrNotFound) // ErrStreamNotFound is returned when a stream identifier does not exist. ErrStreamNotFound = awserr.New("stream not found", awserr.ErrNotFound) // ErrPolicyNotFound is returned when a cluster has no resource policy set. ErrPolicyNotFound = awserr.New("cluster policy not found", awserr.ErrNotFound) // ErrDeletionProtected is returned when DeleteCluster is called on a // cluster with deletionProtectionEnabled set. ErrDeletionProtected = awserr.New("cluster has deletion protection enabled", awserr.ErrInvalidParameter) // ErrValidation is returned when request input fails validation. ErrValidation = awserr.New("invalid argument", awserr.ErrInvalidParameter) // ErrPolicyVersionMismatch is returned when an expectedPolicyVersion does // not match the cluster's current policy version. ErrPolicyVersionMismatch = awserr.New("policy version mismatch", awserr.ErrConflict) // ErrClusterQuotaExceeded is returned when an account/region would exceed // the emulated per-region cluster quota. ErrClusterQuotaExceeded = errors.New("cluster quota exceeded") // ErrStreamQuotaExceeded is returned when a cluster would exceed the // emulated per-cluster stream quota. ErrStreamQuotaExceeded = errors.New("stream quota exceeded") )
var ErrNoSnapshot = errors.New("backend does not support restore")
ErrNoSnapshot is returned when a backend does not support snapshot/restore.
var ErrTokenReused = awserr.New("client token was already used with different parameters", awserr.ErrConflict)
ErrTokenReused is a clientToken reused with different parameters; the SDK declares only ConflictException for it.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
CreationTime time.Time
PendingUntil time.Time
Policy *ClusterPolicy
MultiRegion *MultiRegionProperties
Tags map[string]string
Identifier string
ARN string
Endpoint string
Status string
KmsEncryptionKey string
AccountID string
Region string
DeletionProtectionEnabled bool
}
Cluster is the persisted representation of an Aurora DSQL cluster.
type ClusterPolicy ¶
ClusterPolicy is a resource-based policy attached to a cluster.
type CreateClusterInput ¶
type CreateClusterInput struct {
MultiRegion *MultiRegionProperties
Tags map[string]string
Policy string
KmsEncryptionKey string
DeletionProtectionEnabled bool
}
CreateClusterInput carries CreateCluster's optional fields.
type CreateStreamInput ¶
type CreateStreamInput struct {
Target *StreamTarget
Tags map[string]string
Format string
Ordering string
}
CreateStreamInput carries CreateStream's fields.
type Handler ¶
type Handler struct {
Backend StorageBackend
AccountID string
DefaultRegion string
// contains filtered or unexported fields
}
Handler is the HTTP handler for the Aurora DSQL REST-JSON control-plane API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Aurora DSQL handler backed by backend.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Aurora DSQL requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Restore ¶
Restore implements persistence by delegating to the backend if it supports it.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Aurora DSQL REST API requests.
/tags/{arn} is SigV4-scoped rather than claimed unconditionally: it is a generic-tagging path many restjson1 services reuse verbatim (see .claude/memories/route-matcher-prefix-collision.md), so an unscoped claim here would swallow another service's own TagResource/UntagResource/ ListTagsForResource requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates a new in-memory Aurora DSQL backend.
func (*InMemoryBackend) CreateCluster ¶
func (b *InMemoryBackend) CreateCluster(accountID, region string, in CreateClusterInput) (*Cluster, error)
CreateCluster creates a new Aurora DSQL cluster. New clusters start CREATING and lazily transition to ACTIVE on the next read once clusterActivationDelay elapses -- see PARITY.md for why this is a lazy deadline rather than a background reconciler.
func (*InMemoryBackend) CreateStream ¶
func (b *InMemoryBackend) CreateStream(clusterIdentifier string, in CreateStreamInput) (*Stream, error)
CreateStream creates a Kinesis change-data-capture stream on a cluster. New streams start CREATING and lazily transition to ACTIVE on the next read once streamActivationDelay elapses.
func (*InMemoryBackend) DeleteCluster ¶
func (b *InMemoryBackend) DeleteCluster(identifier string) (*Cluster, error)
DeleteCluster marks a cluster DELETING; it is lazily removed from the table clusterDeletionDelay after this call, on the next resolve. A cluster with deletion protection enabled cannot be deleted.
func (*InMemoryBackend) DeleteClusterPolicy ¶
func (b *InMemoryBackend) DeleteClusterPolicy(identifier, expectedVersion string) (*ClusterPolicy, error)
DeleteClusterPolicy removes a cluster's resource-based policy. If expectedVersion is non-empty it must match the current policy version.
func (*InMemoryBackend) DeleteStream ¶
func (b *InMemoryBackend) DeleteStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
DeleteStream marks a stream DELETING; it is lazily removed streamDeletionDelay later, on the next read.
func (*InMemoryBackend) GetCluster ¶
func (b *InMemoryBackend) GetCluster(identifier string) (*Cluster, error)
GetCluster returns the current information about a cluster.
func (*InMemoryBackend) GetClusterPolicy ¶
func (b *InMemoryBackend) GetClusterPolicy(identifier string) (*ClusterPolicy, error)
GetClusterPolicy returns a cluster's resource-based policy.
func (*InMemoryBackend) GetStream ¶
func (b *InMemoryBackend) GetStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
GetStream returns the current information about a stream.
func (*InMemoryBackend) GetVpcEndpointServiceName ¶
func (b *InMemoryBackend) GetVpcEndpointServiceName(identifier, region string) (string, string, error)
GetVpcEndpointServiceName returns the VPC endpoint service name and cluster-specific VPC endpoint DNS name a client would use to reach the cluster privately. There is no real VPC/PrivateLink plane behind this emulator, so both values are wire-shaped but not backed by a functioning endpoint -- see PARITY.md.
func (*InMemoryBackend) ListClusters ¶
func (b *InMemoryBackend) ListClusters(nextToken string, maxResults int) ([]*Cluster, string, error)
ListClusters returns clusters ordered by identifier, paginated by nextToken/maxResults.
func (*InMemoryBackend) ListStreams ¶
func (b *InMemoryBackend) ListStreams(clusterIdentifier, nextToken string, maxResults int) ([]*Stream, string, error)
ListStreams returns a cluster's streams ordered by stream identifier, paginated by nextToken/maxResults.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags on a cluster.
func (*InMemoryBackend) PutClusterPolicy ¶
func (b *InMemoryBackend) PutClusterPolicy(identifier, policy, expectedVersion string) (*ClusterPolicy, error)
PutClusterPolicy creates or replaces a cluster's resource-based policy. If expectedVersion is non-empty it must match the current policy version (optimistic concurrency), matching PutClusterPolicyInput's expectedPolicyVersion semantics.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore deserializes backend state from a JSON snapshot.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serializes backend state to JSON.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds or replaces tags on a cluster identified by its ARN.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a cluster by key.
func (*InMemoryBackend) UpdateCluster ¶
func (b *InMemoryBackend) UpdateCluster(identifier string, in UpdateClusterInput) (*Cluster, error)
UpdateCluster updates a cluster's mutable configuration and transitions it through UPDATING back to ACTIVE on the next read.
type MultiRegionProperties ¶
MultiRegionProperties mirrors types.MultiRegionProperties.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Aurora DSQL service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Aurora DSQL service backend and handler.
type Snapshottable ¶
type Snapshottable interface {
Snapshot(ctx context.Context) []byte
Restore(context.Context, []byte) error
}
Snapshottable is an optional interface a StorageBackend may implement to support snapshot/restore for persistence or test isolation.
type StorageBackend ¶
type StorageBackend interface {
CreateCluster(accountID, region string, in CreateClusterInput) (*Cluster, error)
GetCluster(identifier string) (*Cluster, error)
ListClusters(nextToken string, maxResults int) ([]*Cluster, string, error)
UpdateCluster(identifier string, in UpdateClusterInput) (*Cluster, error)
DeleteCluster(identifier string) (*Cluster, error)
GetClusterPolicy(identifier string) (*ClusterPolicy, error)
PutClusterPolicy(identifier, policy, expectedVersion string) (*ClusterPolicy, error)
DeleteClusterPolicy(identifier, expectedVersion string) (*ClusterPolicy, error)
GetVpcEndpointServiceName(identifier, region string) (serviceName, clusterVpcEndpoint string, err error)
CreateStream(clusterIdentifier string, in CreateStreamInput) (*Stream, error)
GetStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
DeleteStream(clusterIdentifier, streamIdentifier string) (*Stream, error)
ListStreams(clusterIdentifier, nextToken string, maxResults int) ([]*Stream, string, error)
TagResource(resourceARN string, tags map[string]string) error
UntagResource(resourceARN string, tagKeys []string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
Reset()
}
StorageBackend is the interface for the Aurora DSQL backend.
type Stream ¶
type Stream struct {
CreationTime time.Time
PendingUntil time.Time
Target *StreamTarget
Tags map[string]string
ClusterIdentifier string
StreamIdentifier string
ARN string
Status string
Format string
Ordering string
}
Stream is the persisted representation of an Aurora DSQL change-data-capture stream.
type StreamTarget ¶
StreamTarget mirrors types.TargetDefinitionMemberKinesis.
type UpdateClusterInput ¶
type UpdateClusterInput struct {
MultiRegion *MultiRegionProperties
DeletionProtectionEnabled *bool
KmsEncryptionKey string
}
UpdateClusterInput carries UpdateCluster's optional fields. A nil pointer means "leave unchanged"; KmsEncryptionKey uses the empty string to mean "unchanged" and the reserved value "AWS_OWNED_KMS_KEY" to mean "revert to the AWS owned key", matching the real API's documented semantics.