endoflife

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package endoflife provides a client for the endoflife.date API. It returns product lifecycle data including release dates, EOL dates, and support status for software products and runtimes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client queries the endoflife.date API.

func New

func New(userAgent ...string) *Client

New creates a new endoflife.date client.

func (*Client) GetAllProducts

func (c *Client) GetAllProducts(ctx context.Context) ([]string, error)

GetAllProducts returns the list of all product names tracked by endoflife.date.

func (*Client) GetCycle

func (c *Client) GetCycle(ctx context.Context, product, cycle string) (*Cycle, error)

GetCycle returns lifecycle information for a specific release cycle of a product. For example, GetCycle(ctx, "python", "3.12") or GetCycle(ctx, "nodejs", "22").

func (*Client) GetProduct

func (c *Client) GetProduct(ctx context.Context, product string) ([]Cycle, error)

GetProduct returns all release cycles for a product. The product name should match endoflife.date naming (e.g. "python", "nodejs", "ruby").

type Cycle

type Cycle struct {
	Name              string     `json:"cycle"`
	ReleaseDate       Date       `json:"releaseDate"`
	EOL               DateOrBool `json:"eol"`
	Latest            string     `json:"latest"`
	LatestReleaseDate Date       `json:"latestReleaseDate"`
	LTS               DateOrBool `json:"lts"`
	Support           DateOrBool `json:"support"`
	ExtendedSupport   DateOrBool `json:"extendedSupport"`
}

Cycle contains lifecycle information for a single release cycle of a product.

func (*Cycle) IsEOL

func (c *Cycle) IsEOL() bool

IsEOL reports whether this cycle has reached end of life.

func (*Cycle) IsLTS

func (c *Cycle) IsLTS() bool

IsLTS reports whether this cycle is a long-term support release.

func (*Cycle) IsSupported

func (c *Cycle) IsSupported() bool

IsSupported reports whether this cycle still receives active support (bug fixes, not just security patches).

type Date

type Date struct {
	time.Time
}

Date is a date parsed from the "YYYY-MM-DD" format used by the API.

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

type DateOrBool

type DateOrBool struct {
	Date Date
	Bool *bool
}

DateOrBool represents a field that can be either a date string ("2025-04-30") or a boolean (true/false). The endoflife.date API uses this for eol, lts, support, and extendedSupport fields.

func (DateOrBool) MarshalJSON

func (d DateOrBool) MarshalJSON() ([]byte, error)

func (*DateOrBool) UnmarshalJSON

func (d *DateOrBool) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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