cloudfrontkeyvaluestore

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 13 Imported by: 0

README

Cloudfrontkeyvaluestore

Parity grade: B · SDK aws-sdk-go-v2/service/cloudfrontkeyvaluestore@v1.15.4 · last audited 2026-08-13 (1e78b7ca4)

Coverage

Metric Value
PARITY entries audited 6 (6 ok)
Known gaps 3
Structural gaps (can't be emulated) 1
Deferred items 0
Resource leaks clean
Known gaps
  • TotalSizeInBytes is len(key)+len(value) summed per item. AWS's real byte accounting includes undocumented per-item overhead this emulator cannot replicate exactly; the number is real and deterministic (derived from actual stored data, not fabricated) but will not byte-for-byte match a real account. (bd: gopherstack-4ara)
  • UpdateKeys is not transactional: puts and deletes apply sequentially against the shared InMemoryBackend lock rather than as a single all-or-nothing batch. A backend error partway through (never currently possible, since PutKVSValue/DeleteKVSValue on an already-validated store/ETag cannot fail mid-batch) would leave a partial result. (bd: gopherstack-4ara)
  • No per-store size quota (AWS documents ~5MB/store, 1KB/value limits) and no AccessDeniedException path (no IAM enforcement in this emulator) -- see errors.go's doc comment. ServiceQuotaExceededException/AccessDeniedException are therefore never returned, though both are in the real client's exception set for several ops. (bd: gopherstack-4ara)
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • None. Every op here reads or mutates real per-KVS-store key/value state (services/cloudfront's keyValueStoreData/keyValueDataETags) -- there is no billing/ML/hardware dependency that would make any of these ops structurally unimplementable.

More

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

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

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

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

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS-style service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for the request's method+path.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the target Key Value Store's ARN.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

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

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service identifier, matching the real SDK's ServiceID ("CloudFront KeyValueStore", cloudfrontkeyvaluestore@v1.15.4 api_client.go).

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

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

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.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

Jump to

Keyboard shortcuts

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