github

package
v0.3.0-beta.25 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPublishCredentialUnavailable = errors.New("github: publish credential unavailable")

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

func (c *Client) Search(ctx context.Context, query string, opts registry.SearchOpts) ([]registry.Listing, error)

Search discovers repositories carrying the Compozy extension topic.

func (*Client) UploadRelease

func (c *Client) UploadRelease(
	ctx context.Context,
	request ReleaseUploadRequest,
) (ReleaseUploadResult, error)

UploadRelease creates or updates a GitHub release and uploads its archive plus digest sidecar. Authentication is carried only by the client.

type Option

type Option func(*Client)

Option customizes a GitHub client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient provides the base HTTP client wrapped by the outbound network policy.

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.

type ReleaseUploadRequest

type ReleaseUploadRequest struct {
	Repository    string
	TagName       string
	Draft         bool
	AssetName     string
	Archive       []byte
	DigestSidecar []byte
}

ReleaseUploadRequest contains publishable release data. Credentials remain bound to the uploader and never enter this request.

type ReleaseUploadResult

type ReleaseUploadResult struct {
	ReleaseURL string
	AssetURL   string
}

ReleaseUploadResult reports the published release and archive locations.

type ReleaseUploader

type ReleaseUploader interface {
	UploadRelease(context.Context, ReleaseUploadRequest) (ReleaseUploadResult, error)
}

ReleaseUploader uploads a release archive and its SHA-256 sidecar.

Jump to

Keyboard shortcuts

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