github

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package github implements the GitHub Releases registry adapter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the GitHub Releases registry source.

func NewClient

func NewClient(baseURL string, opts ...Option) *Client

NewClient constructs a GitHub Releases registry client.

func (*Client) Capabilities

func (c *Client) Capabilities() registry.SourceCaps

Capabilities reports which registry operations GitHub supports.

func (*Client) Close

func (c *Client) Close() error

Close releases any idle HTTP connections held by the client.

func (*Client) Download

func (c *Client) Download(
	ctx context.Context,
	slug string,
	opts registry.DownloadOpts,
) (*registry.DownloadResult, error)

Download fetches the selected release archive stream.

func (*Client) Info

func (c *Client) Info(ctx context.Context, slug string) (*registry.Detail, error)

Info fetches metadata from the latest published release and page one of the releases listing.

func (*Client) Name

func (c *Client) Name() string

Name reports the registry source name.

func (*Client) Search

Search reports that the GitHub Releases adapter is slug-only.

type Option

type Option func(*Client)

Option customizes a GitHub client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient overrides the underlying HTTP client.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger overrides the logger used for rate-limit warnings.

func WithRetryPolicy

func WithRetryPolicy(initial, maxDelay time.Duration, retries int) Option

WithRetryPolicy overrides the retry policy used for retryable responses.

func WithSleep

func WithSleep(sleep func(context.Context, time.Duration) error) Option

WithSleep overrides the retry sleep function.

func WithToken

func WithToken(token string) Option

WithToken overrides the GitHub token used for authenticated requests.

Jump to

Keyboard shortcuts

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