Documentation
¶
Index ¶
Constants ¶
const DefaultCacheTTL = 60 * time.Second
DefaultCacheTTL is the TTL applied when caching is enabled and no other value is specified. Kept short because PR state (CI, review decision, merge status) can change minute-to-minute.
Variables ¶
This section is empty.
Functions ¶
func DecodeForTests ¶
DecodeForTests decodes a GraphQL response envelope captured as JSON (matching the shape of testdata/fixtures/*.json) into a *model.Repo. Exported solely so internal/render tests can drive golden comparisons. Do not use in production code.
func DefaultCacheDir ¶
func DefaultCacheDir() string
DefaultCacheDir returns the per-user cache directory for gh-prs entries. Falls back to a sibling of the binary's temp dir if UserCacheDir is not resolvable (very rare on macOS/Linux; e.g. HOME unset in a sandbox).
Types ¶
type Options ¶
type Options struct {
// Debug enables httpretty-style logging of the GraphQL request/response
// (URL, headers, body, timing) to DebugOut. Honors DebugColor for ANSI.
Debug bool
DebugOut io.Writer
DebugColor bool
// EnableCache turns on go-gh's disk cache for the GraphQL POST. When on,
// identical queries within CacheTTL are served from CacheDir without a
// network round trip. CacheDir empty => go-gh default.
EnableCache bool
CacheTTL time.Duration
CacheDir string
}
Options configures the GitHub client. Zero-value is safe: no debug, no cache.