anitya

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultBaseURL is the base URL for the release-monitoring.org API
	DefaultBaseURL = "https://release-monitoring.org/api/v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a client for the release-monitoring.org API

func New

func New(httpClient *http.Client) *Client

New creates a new anitya client with a custom HTTP client The httpClient parameter is required and should be obtained from httpclient.NewHTTPClientWithTimeout()

func (*Client) GetLatestVersion

func (c *Client) GetLatestVersion(ctx context.Context, id int) (string, error)

GetLatestVersion returns the latest version for a project by ID

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, id int) (*Project, error)

GetProject fetches a project by its ID

func (*Client) GetStableVersions

func (c *Client) GetStableVersions(ctx context.Context, id int) ([]string, error)

GetStableVersions returns all stable versions for a project by ID

func (*Client) IsAuthenticated

func (c *Client) IsAuthenticated() bool

IsAuthenticated checks if the client is using authentication

type Project

type Project struct {
	ID             int      `json:"id"`
	Name           string   `json:"name"`
	Backend        string   `json:"backend"`
	Ecosystem      string   `json:"ecosystem"`
	Homepage       string   `json:"homepage"`
	CreatedOn      UnixTime `json:"created_on"`
	UpdatedOn      UnixTime `json:"updated_on"`
	Version        string   `json:"version"`
	StableVersions []string `json:"stable_versions"`
	Versions       []string `json:"versions"`
}

Project represents a project from the release-monitoring.org API

type ProjectResponse

type ProjectResponse struct {
	Items      []Project `json:"items"`
	Page       int       `json:"page"`
	ItemsCount int       `json:"items_count"`
	Total      int       `json:"total"`
}

ProjectResponse represents the API response structure

type UnixTime

type UnixTime time.Time

UnixTime represents a Unix timestamp that can be unmarshaled from JSON

func (UnixTime) Time

func (ut UnixTime) Time() time.Time

Time returns the time.Time representation

func (*UnixTime) UnmarshalJSON

func (ut *UnixTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for UnixTime

Jump to

Keyboard shortcuts

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