github

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageURL added in v0.19.0

func PackageURL(reference oci.Reference) string

PackageURL returns the URL to a GitHub package, assuming the reference is a valid image hosted on GHCR.

func ParseURL

func ParseURL(u string) (string, string, string, string, bool)

ParseURL returns the endpoint, owner, repository and path for GitHub URLs.

Types

type Client

type Client struct {
	// Endpoint is the GitHub endpoint. Useful for using an enterprise instance,
	// for example. Defaults to "https://github.com".
	Endpoint string
	Client   httputil.Requester
}

func (*Client) GetDescription

func (c *Client) GetDescription(ctx context.Context, owner string, repository string) (string, error)

GetDescription returns the description of a repository.

func (*Client) GetPackage

func (c *Client) GetPackage(ctx context.Context, reference oci.Reference) (*Package, error)

GetPackage returns information about a GHCR package.

func (*Client) GetREADME

func (c *Client) GetREADME(ctx context.Context, url string) (string, error)

GetREADME retrieves the README at url.

func (*Client) GetRelease

func (c *Client) GetRelease(ctx context.Context, owner string, repository string, tag string) (*Release, error)

GetRelease returns information about a release of a repository.

type Package

type Package struct {
	Owner      string
	Repository string
	ReadmeURL  string
}

type Release

type Release struct {
	Owner       string
	Repository  string
	Tag         string
	Released    time.Time
	Title       string
	Description string
	URL         string
}

Jump to

Keyboard shortcuts

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