github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

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
}

func NewClient

func NewClient(token string) *Client

func NewTestClient

func NewTestClient(baseURL string) *Client

NewTestClient creates a client pointing to a custom base URL (for testing).

func (*Client) GetRepository

func (c *Client) GetRepository(owner, repo string) (*Repository, error)

GetRepository fetches detailed information about a specific repository.

func (*Client) GetTrending

func (c *Client) GetTrending(language string, since string, perPage int) (*SearchResult, error)

GetTrending fetches trending repositories by looking at recently created repos with high star counts.

func (*Client) GetTrendingByStars

func (c *Client) GetTrendingByStars(language string, since string, perPage int) (*SearchResult, error)

GetTrendingByStars fetches repos that gained the most stars recently.

func (*Client) SearchRepositories

func (c *Client) SearchRepositories(query string, sort string, order string, perPage int) (*SearchResult, error)

SearchRepositories searches GitHub repositories with the given query and options.

type License

type License struct {
	Key    string `json:"key"`
	Name   string `json:"name"`
	SPDXID string `json:"spdx_id"`
}

type Owner

type Owner struct {
	Login     string `json:"login"`
	AvatarURL string `json:"avatar_url"`
	HTMLURL   string `json:"html_url"`
}

type Repository

type Repository struct {
	FullName        string    `json:"full_name"`
	Name            string    `json:"name"`
	Owner           Owner     `json:"owner"`
	Description     string    `json:"description"`
	HTMLURL         string    `json:"html_url"`
	Homepage        string    `json:"homepage"`
	Language        string    `json:"language"`
	StargazersCount int       `json:"stargazers_count"`
	ForksCount      int       `json:"forks_count"`
	OpenIssuesCount int       `json:"open_issues_count"`
	WatchersCount   int       `json:"watchers_count"`
	Topics          []string  `json:"topics"`
	License         *License  `json:"license"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	PushedAt        time.Time `json:"pushed_at"`
	Archived        bool      `json:"archived"`
	Fork            bool      `json:"fork"`
}

type SearchResult

type SearchResult struct {
	TotalCount int          `json:"total_count"`
	Items      []Repository `json:"items"`
}

Jump to

Keyboard shortcuts

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