Documentation
¶
Overview ¶
Package sdkcheck provides helpers for verifying that gopherstack service handlers cover all operations exposed by the corresponding AWS SDK v2 client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCompleteness ¶
func CheckCompleteness(tb testing.TB, sdkClientPtr any, supportedOps []string, notImplemented []string)
CheckCompleteness verifies that every exported method on sdkClientPtr is either listed in supportedOps (the handler's GetSupportedOperations slice) or explicitly listed in notImplemented. It also performs quality checks on the two lists themselves, in both directions: every SDK method must be accounted for, and every entry in notImplemented must correspond to a real SDK method. A third, currently non-fatal check reports supportedOps entries that don't correspond to a real SDK method ("phantom" operations) via tb.Logf — see the rollout note beside that check in the implementation for why it isn't a hard failure yet.
sdkClientPtr must be a non-nil pointer to an AWS SDK v2 Client struct, e.g. &s3.Client{}.
The test fails if:
- sdkClientPtr is nil or not a pointer type.
- An SDK method is not accounted for in either list (new upstream operation).
- notImplemented contains entries that are not real SDK methods (typos / SDK renames).
- notImplemented contains duplicate entries.
- supportedOps contains duplicate entries.
- supportedOps and notImplemented contain overlapping entries.
The test logs (but does not fail) when:
- supportedOps contains entries that are not real SDK methods (a "phantom" operation — the handler claims to support something AWS doesn't have, or the check is being run against the wrong sibling SDK client).
The "Options" method, which exists on every AWS SDK v2 Client but is not an API operation, is always excluded from the check.
Types ¶
This section is empty.