Documentation
¶
Overview ¶
Package cloudfrontkeyvaluestore implements the AWS CloudFront KeyValueStore data-plane API (GetKey/PutKey/DeleteKey/ListKeys/UpdateKeys/ DescribeKeyValueStore). AWS models this as a separate SDK client and protocol from the main cloudfront.Client -- see Handler's doc comment for why this package exists instead of living inside services/cloudfront.
Index ¶
- 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) RouteMatcher() service.Matcher
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Backend *cloudfrontbackend.InMemoryBackend
}
Handler handles HTTP requests for CloudFront KeyValueStore data-plane operations.
Handler intentionally owns no independent state and therefore does not implement the Snapshot/Restore persistable shape that cli.go's setupPersistence auto-registers. It is wired (in cli.go's wireCloudFrontKeyValueStore) directly to the CloudFront service's *InMemoryBackend, which already owns and persists every KVS store's metadata (keyValueStores) and key/value data (keyValueStoreData/keyValueDataETags, see services/cloudfront/persistence.go) -- the same real state services/cloudfront's own KVS *control-plane* ops (CreateKeyValueStore etc.) act on. Implementing Snapshot/Restore here would register a second entry that duplicates and re-restores that same shared backend object. Mirrors services/dynamodbstreams's relationship to services/dynamodb (see that package's handler.go doc comment and persistence_test.go for the guard test on this invariant).
func NewHandler ¶
func NewHandler(backend *cloudfrontbackend.InMemoryBackend) *Handler
NewHandler creates a new CloudFront KeyValueStore handler with the given backend.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles. KVS data is not region-partitioned in this emulator (mirrors the real service's per-store, not per-region, scoping), so this always returns empty.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS-style service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for the request's method+path.
func (*Handler) ExtractResource ¶
ExtractResource returns the target Key Value Store's ARN.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the operations this handler supports.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for CloudFront KeyValueStore requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Name ¶
Name returns the service identifier, matching the real SDK's ServiceID ("CloudFront KeyValueStore", cloudfrontkeyvaluestore@v1.15.4 api_client.go).
func (*Handler) RouteMatcher ¶
RouteMatcher matches the real client's unversioned "/key-value-stores/..." path family -- distinct from services/cloudfront's "/2020-05-31/..." prefix, which is exactly why these ops need their own service (see services/cloudfront/PARITY.md).
type Provider ¶
type Provider struct{}
Provider implements service.Provider for CloudFront KeyValueStore.
func (*Provider) Init ¶
func (p *Provider) Init(_ *service.AppContext) (service.Registerable, error)
Init initializes the CloudFront KeyValueStore handler with a nil backend. The backend is wired later in cli.go via wireCloudFrontKeyValueStore(), which points it at the CloudFront service's *InMemoryBackend -- see handler.go's Handler doc comment for why this service owns no state of its own.