Documentation
¶
Overview ¶
Package node resolves Node.js runtime versions from nodejs.org's public, unauthenticated release index. The index lists every release newest-first in a single response, so discovery is one fetch with no pagination; each candidate carries the release date the index supplies. By default it tracks all releases; lts restricts to the long-term-support lines. Checksums are left to a follower reading the version's predictable SHASUMS256.txt file.
Index ¶
- type Option
- type Provider
- func (p *Provider) Color(dark bool) color.Color
- func (p *Provider) Dated()
- func (p *Provider) Describe(r provider.Resource) string
- func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)
- func (p *Provider) Identify(r provider.Resource) (string, string)
- func (p *Provider) Keys() []provider.Key
- func (p *Provider) Name() string
- func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)
- func (p *Provider) URL(r provider.Resource, c model.Candidate) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport overrides the HTTP transport, for tests.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider resolves Node.js runtime versions from nodejs.org's public, unauthenticated release index. The index is a single newest-first JSON listing of every release, so the provider fetches it once and lets the framework own selection; it only lists candidates and tags each with the release date the index returns for free.
func New ¶
New returns the Node.js provider. The release index is public and publishes no rate-limit headers, so the client is a plain cached one with no ratelimit wrapper or credentials.
func (*Provider) Color ¶ added in v0.3.10
Color is the provider's brand color. See provider.Provider.Color.
func (*Provider) Dated ¶ added in v0.2.8
func (p *Provider) Dated()
Dated marks the listing as date-bearing: every release carries a publication date, so cooldown applies.
func (*Provider) Describe ¶
Describe returns a human-readable label for a resource, noting when it is scoped to the LTS lines.
func (*Provider) Discover ¶
Discover lists candidate Node.js versions, reading the release index in one fetch. The index holds the whole release history newest-first in a single response, so there is no pagination and nothing is ever left unread - --deep has no work to do here.
func (*Provider) URL ¶
URL builds the web page for a resolved candidate: the version's artifact directory on nodejs.org. It links via the upstream ref, which keeps the v-prefix the dist path requires - the current-version candidate carries the bare on-line value in Version but the v-prefixed form in Ref. Empty when the version is unknown.