githubretriever

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 25 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retriever

type Retriever struct {
	Branch         string // default is main
	FilePath       string
	GithubToken    string
	RepositorySlug string
	// BaseURL is the base URL for the GitHub API.
	// If not specified, it defaults to "https://api.github.com" for GitHub.com.
	// For GitHub Enterprise instances, specify your instance URL (e.g., "https://github.acme.com/api/v3").
	BaseURL string

	PrivateKey     string // PEM-encoded RSA private key
	PrivateKeyFile string // path to a PEM file; takes precedence over PrivateKey if both are set

	Timeout time.Duration // default is 10 seconds

	InstallationID int64
	// GitHub App authentication fields.
	// AppID and InstallationID are required together with either
	// PrivateKey (PEM string) or PrivateKeyFile (path to a PEM file).
	// Mutually exclusive with GithubToken / AuthToken.
	AppID int64
	// contains filtered or unexported fields
}

Retriever is a configuration struct for a GitHub retriever.

func (*Retriever) Init

func (r *Retriever) Init(_ context.Context, _ *fflog.FFLogger) error

Init validates the authentication configuration.

func (*Retriever) Retrieve

func (r *Retriever) Retrieve(ctx context.Context) ([]byte, error)

Retrieve is the function in charge of fetching the flag configuration.

func (*Retriever) SetHTTPClient

func (r *Retriever) SetHTTPClient(client internal.HTTPClient)

SetHTTPClient is here if you want to override the default http.Client we are using. It is also used for the tests.

func (*Retriever) Shutdown

func (r *Retriever) Shutdown(_ context.Context) error

Shutdown drops the cached installation token and sets the status as not ready.

func (*Retriever) Status

func (r *Retriever) Status() retriever.Status

Status is the function returning the internal state of the retriever.

Jump to

Keyboard shortcuts

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