Documentation
¶
Index ¶
- Variables
- func AnthropicBaseURL() string
- func CircleCIBaseURL() string
- func GitHubBaseURL() string
- func ResolveAnthropicClient() (*anthropic.Client, error)
- func ResolveCircleCIClient() (*circleci.Client, error)
- func ResolveGitHubClient() (*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 AnthropicBaseURL ¶
func AnthropicBaseURL() string
AnthropicBaseURL returns the configured Anthropic base URL from the environment.
func CircleCIBaseURL ¶
func CircleCIBaseURL() string
CircleCIBaseURL returns the configured CircleCI base URL from the environment.
func GitHubBaseURL ¶
func GitHubBaseURL() string
GitHubBaseURL returns the configured GitHub API URL from the environment.
func ResolveAnthropicClient ¶
ResolveAnthropicClient returns an Anthropic client if credentials are available in env vars or config. Returns ErrNeedsAuth when the caller must prompt.
func ResolveCircleCIClient ¶
ResolveCircleCIClient returns a CircleCI client if credentials are available in env vars or config. Returns ErrNeedsAuth when the caller must prompt.
func ResolveGitHubClient ¶
ResolveGitHubClient returns a GitHub client if credentials are available in env vars or config. 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.