lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 11 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 {
	OfficialURL           *url.URL
	TrendingRepositoryURL *url.URL
	HTTPClient            *http.Client
}

func NewClient

func NewClient() (*Client, error)

func (*Client) GetReadme

func (client *Client) GetReadme(item Item) (*Readme, error)

func (*Client) GetTrendingRepository

func (client *Client) GetTrendingRepository(language string, since string) (*Result, error)

func (*Client) SearchRepository

func (client *Client) SearchRepository(query string) (*Result, error)

type Item

type Item struct {
	ID              int      `json:"id"`
	Name            string   `json:"name,repo"`
	FullName        string   `json:"full_name"`
	URL             string   `json:"repo_link"`
	HTMLURL         string   `json:"html_url"`
	CloneURL        string   `json:"clone_url"`
	Description     string   `json:"description"`
	Desc            string   `json:"desc"`
	StargazersCount int      `json:"stargazers_count,stars"`
	Stars           string   `json:"stars"`
	Watchers        int      `json:"watchers"`
	Topics          []string `json:"topics"`
	Language        string   `json:"language"`
	Lang            string   `json:"lang"`
	DefaultBranch   string   `json:"default_branch"`
	CreatedAt       string   `json:"created_at"`
	UpdatedAt       string   `json:"updated_at"`
	DataSource      string
}

func (*Item) GetCloneURL

func (item *Item) GetCloneURL() string

func (*Item) GetDescription added in v0.0.2

func (item *Item) GetDescription() string

func (*Item) GetLanguage added in v0.0.2

func (item *Item) GetLanguage() string

func (*Item) GetRepositoryName

func (item *Item) GetRepositoryName() string

func (*Item) GetRepositoryURL

func (item *Item) GetRepositoryURL() string

func (*Item) GetStars

func (item *Item) GetStars() int

func (*Item) String

func (item *Item) String() string

type Readme

type Readme struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	HTMLURL     string `json:"html_url"`
	DownloadURL string `json:"download_url"`
	Content     string `json:"content"`
}

type Result

type Result struct {
	Items []Item `json:"items"`
}

func (*Result) Draw

func (result *Result) Draw(writer io.Writer) error

Jump to

Keyboard shortcuts

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