resolver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitedError

type RateLimitedError struct {
	Authenticated bool
	Wrapped       error
}

RateLimitedError is returned for any GitHub call that hit a rate / abuse limit. The Authenticated bit lets callers tailor the message.

func (*RateLimitedError) Error

func (e *RateLimitedError) Error() string

func (*RateLimitedError) Unwrap

func (e *RateLimitedError) Unwrap() error

type Resolver

type Resolver struct {
	GH            *github.Client
	Authenticated bool
	// contains filtered or unexported fields
}

Resolver wraps a GitHub client and tracks whether it is authenticated. It memoizes successful lookups in-process and uses singleflight to dedupe concurrent identical lookups.

func New

func New(token string) *Resolver

New builds a resolver. If token is empty, the client is unauthenticated.

func (*Resolver) LatestReleaseSHA

func (r *Resolver) LatestReleaseSHA(owner, repo string) (sha string, srcTag string, err error)

LatestReleaseSHA returns the SHA pointed at by the most recent tag on owner/repo. Falls back to the default branch HEAD if the repo has no tags. Successful results are memoized; concurrent identical lookups share one API call via singleflight.

We use ListTags because not every action publishes formal "releases" — many just tag.

func (*Resolver) ResolveRef

func (r *Resolver) ResolveRef(owner, repo, ref string) (string, error)

ResolveRef returns the commit SHA that `ref` (branch or tag) points at for owner/repo. Successful results are memoized; concurrent identical lookups share a single API call via singleflight.

Jump to

Keyboard shortcuts

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