Documentation
¶
Index ¶
- Variables
- func ResolveAnthropicClient(rc config.ResolvedConfig) (*anthropic.Client, error)
- func ResolveCircleCIClient(rc config.ResolvedConfig) (*circleci.Client, error)
- func ResolveGitHubClient(rc config.ResolvedConfig, logStatus func(string)) (*github.Client, error)
- func SaveAnthropicKey(key string) error
- func SaveCircleCIToken(token string) error
- func SaveGitHubToken(token string) error
- func ValidateAPIKey(ctx context.Context, apiKey, baseURL string) error
- func ValidateCircleCIToken(ctx context.Context, token, baseURL string) error
- func ValidateGitHubToken(ctx context.Context, token, baseURL string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNeedsAuth = errors.New("authentication required")
ErrNeedsAuth is returned by Resolve* functions when no credentials are available in env vars or config, indicating that the caller should prompt the user interactively.
Functions ¶
func ResolveAnthropicClient ¶
func ResolveAnthropicClient(rc config.ResolvedConfig) (*anthropic.Client, error)
ResolveAnthropicClient returns an Anthropic client if credentials are available. Returns ErrNeedsAuth when the caller must prompt.
func ResolveCircleCIClient ¶
func ResolveCircleCIClient(rc config.ResolvedConfig) (*circleci.Client, error)
ResolveCircleCIClient returns a CircleCI client if credentials are available. Returns ErrNeedsAuth when the caller must prompt.
func ResolveGitHubClient ¶
ResolveGitHubClient returns a GitHub client if credentials are available. Returns ErrNeedsAuth when the caller must prompt.
func SaveAnthropicKey ¶
SaveAnthropicKey persists an Anthropic API key to the config file.
func SaveCircleCIToken ¶
SaveCircleCIToken persists a CircleCI token to the config file.
func SaveGitHubToken ¶
SaveGitHubToken persists a GitHub token to the config file.
func ValidateAPIKey ¶
ValidateAPIKey calls POST /v1/messages/count_tokens to confirm the Anthropic key is accepted. A 429 response is treated as valid.
func ValidateCircleCIToken ¶
ValidateCircleCIToken calls GET /api/v2/me to confirm the token is accepted. A 429 response is treated as valid (rate-limited but authenticated).
Types ¶
This section is empty.