externalapi

package
v0.0.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package externalapi wraps the third-party web APIs allbctl talks to behind small interfaces, so callers can be tested without the network.

Index

Constants

View Source
const GithubAuthEnvVar = "GITHUB_TOKEN"

GithubAuthEnvVar is the name of the environment variable the GitHub CLI and allbctl read an access token from. See https://cli.github.com/manual/gh_help_environment (GH_TOKEN is the other default).

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubAuthTokenProvider

type GithubAuthTokenProvider struct{}

GithubAuthTokenProvider reads the GitHub access token from the environment.

func (*GithubAuthTokenProvider) GetAuthToken

func (provider *GithubAuthTokenProvider) GetAuthToken() (string, error)

GetAuthToken returns the token held in GithubAuthEnvVar, or an error when the variable is unset or empty.

type GithubClient

type GithubClient struct {
	Users  githubUsersService
	Search githubSearchService
}

GithubClient is this program's facade of github API client

type GithubClientProvider

type GithubClientProvider struct{}

GithubClientProvider allows consumer to get a GithubClient

func (*GithubClientProvider) GetGithubClient

func (provider *GithubClientProvider) GetGithubClient(ctx context.Context, accessToken string) (GithubClient, error)

GetGithubClient returns a GithubClient whose requests carry accessToken. ctx supplies the HTTP client used for those requests (see oauth2.NewClient); building the client performs no network I/O.

type IGithubClientProvider added in v0.0.9

type IGithubClientProvider interface {
	GetGithubClient(ctx context.Context, accessToken string) (client GithubClient, err error)
}

IGithubClientProvider builds a GithubClient authenticated with an access token.

type IGithubTokenProvider added in v0.0.9

type IGithubTokenProvider interface {
	GetAuthToken() (string, error)
}

IGithubTokenProvider supplies a GitHub access token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL