v1.3.0
Adds etag.WithAutoKeyScope so a single *http.Client can serve
multiple tenants without provisioning N transports. Elevates GraphQL/v4
to first-class billing in the docs: the generic factory already worked
with shurcooL/githubv4, but the lead documentation framed the kit as
a google/go-github (REST) wrapper. No new runtime dependencies in
the root module.
Added
etag.WithAutoKeyScope(fn func(*http.Request) (string, error)): derives
the cache-key scope per request. Mutually exclusive with
etag.WithKeyScope; combining both yieldsetag.ErrConflictingScope.
Either option satisfies the caller-supplied-Cachescope requirement.etag.ErrEmptyScope: sentinel wrapped and returned fromRoundTrip
when the fn returns an empty string with a nil error. The contract is
"non-empty scope or non-nil error"; the empty + nil combination is a
programming error, not a bypass signal.etag.ErrConflictingScope: sentinel surfaced at construction when both
WithKeyScopeandWithAutoKeyScopeare set.
Documentation
doc.golead paragraph rewritten to name bothgoogle/go-github(REST)
andshurcooL/githubv4(GraphQL) as canonical factories. New
paragraphs document GraphQL/v4 compatibility (etag layer no-ops on
POST; v4 traffic flows through oauth2 + retry + ratelimit + throttle- UA without ETag caching) and custom cache backends via the
three-methodetag.Cacheinterface.
- UA without ETag caching) and custom cache backends via the
README.mdlead paragraph elevates GraphQL/v4 to first-class billing.
New recipes: "Recommended setup for a long-lived service",
"GraphQL with shurcooL/githubv4", "Multi-tenant single client (one
Transport, many installations)".MIGRATION.mdRecipe 2 cross-referencesWithAutoKeyScopefor the
multi-installation single-transport pattern.
Examples
examples/installation-token/main.goreplaces the
oauth2.StaticTokenSourcestand-in with an inline
bradleyfalzon/ghinstallation/v2tooauth2.TokenSourceadapter
(the canonical local-key JWT signing path).- New
examples/graphql-v4/runs a minimalViewer.Loginquery through
shurcooL/githubv4over a ghkit-built*http.Client. Pins compile-time
compatibility with the v4 SDK in the examples CI lane.
Dependencies
No changes in the root module. The examples/ module gains
bradleyfalzon/ghinstallation/v2, golang-jwt/jwt/v4 (transitive),
shurcooL/githubv4, and shurcooL/graphql (transitive).