ghapi

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetLatestSHATag returns the most recent sha-* tag for a given container image.
	//
	// Returns empty string if no sha tags are found or if the query fails.
	GetLatestSHATag(ctx context.Context, owner, repo, appName string) (string, error)
}

Client provides methods for interacting with the GitHub API.

func New

func New(token string) Client

New creates a new GitHub API client. If token is empty, the client will be unauthenticated (rate limited).

type DefaultClient

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

DefaultClient implements the Client interface using the official go-github library.

func (*DefaultClient) GetLatestSHATag

func (c *DefaultClient) GetLatestSHATag(ctx context.Context, owner, repo, appName string) (string, error)

GetLatestSHATag queries GHCR for the most recent sha-* tag for a given image. The image name format is: {repo}-{appName} For example: "my-website-web" for repo "my-website" and app "web".

Returns empty string if:

  • No package versions are found
  • No sha-* tags exist
  • API request fails

Jump to

Keyboard shortcuts

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