github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.github.com"

Variables

This section is empty.

Functions

func TLS12HTTPClient

func TLS12HTTPClient(client *http.Client) (*http.Client, error)

TLS12HTTPClient returns a copy of client whose transport caps TLS at 1.2. The client, transport, and TLS configuration passed by the caller are not modified.

Types

type Candidate

type Candidate struct {
	Version     Version
	Eligibility Eligibility
}

type Client

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

func NewClient

func NewClient(httpClient *http.Client, baseURL, token string) *Client

func (*Client) ResolveLatestMajor

func (c *Client) ResolveLatestMajor(ctx context.Context, repo string, currentMajor int, cooldown time.Duration) (Resolution, error)

func (*Client) ResolveLatestStable

func (c *Client) ResolveLatestStable(ctx context.Context, repo string, current actionspec.StableVersion, cooldown time.Duration) (Resolution, error)

func (*Client) ResolvePinned

func (c *Client) ResolvePinned(ctx context.Context, repo string, current actionspec.StableVersion, alreadyPinned bool, cooldown time.Duration) (Resolution, error)

ResolvePinned selects an eligible exact release without downgrading current. Existing exact pins only advance to newer versions, never repointed tags.

func (*Client) WithCacheDir

func (c *Client) WithCacheDir(dir string) *Client

WithCacheDir sets a custom cache directory for testing.

type Decision

type Decision struct {
	Target         Version
	HasUpgrade     bool
	NoUpdateReason NoUpdateReason
}

type Eligibility

type Eligibility int
const (
	EligibilityUnknown Eligibility = iota
	EligibilityEligible
	EligibilityBlocked
)

type NoUpdateReason

type NoUpdateReason string

type Precision

type Precision int
const (
	PrecisionMovingMajor Precision = iota
	PrecisionMovingMinor
	PrecisionExact
)

type Resolution

type Resolution struct {
	TargetRef   string
	HasUpgrade  bool
	Reason      string
	LatestMajor int
	TargetTag   string
	Skipped     bool
}

type Version

type Version struct {
	Original  string
	Major     int
	Minor     int
	Patch     int
	Precision Precision
}

Jump to

Keyboard shortcuts

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