github

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.Client
}

func (*Client) GetDescription

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

func (*Client) GetPackage

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

func (*Client) GetREADME

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

func (*Client) GetRelease

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

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