gh

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(cfg *GithubConfig) error

Types

type GitHubClient

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

func NewGitHubClient

func NewGitHubClient(cfg *GithubConfig) *GitHubClient

func (*GitHubClient) ExistUser

func (c *GitHubClient) ExistUser(id string) bool

func (*GitHubClient) QueryUserProfile

func (c *GitHubClient) QueryUserProfile(id string) (*UserProfile, error)

func (*GitHubClient) QueryUserPullRequests

func (c *GitHubClient) QueryUserPullRequests(id string) (*UserPullRequests, error)

func (*GitHubClient) QueryUserRepositories

func (c *GitHubClient) QueryUserRepositories(id string) (*UserRepositories, error)

type GithubConfig

type GithubConfig struct {
	AccessToken string `json:"access_token"`
}

func Authorize

func Authorize() (*GithubConfig, error)

func LoadConfig

func LoadConfig() (*GithubConfig, error)

type UserProfile

type UserProfile struct {
	Login      string
	Name       string
	Bio        string
	Followers  int
	Following  int
	Location   string
	Company    string
	WebsiteUrl string
	AvatarUrl  string
	Url        string
}

type UserPullRequests

type UserPullRequests struct {
	TotalCount int
	Owners     []*UserPullRequestsOwner
}

func (*UserPullRequests) Owner

type UserPullRequestsOwner

type UserPullRequestsOwner struct {
	Name         string
	Repositories []*UserPullRequestsRepository
}

type UserPullRequestsPullRequest

type UserPullRequestsPullRequest struct {
	Title     string
	State     string
	Number    int
	Url       string
	Additions int
	Deletions int
	Comments  int
	CretaedAt time.Time
	ClosedAt  time.Time
}

type UserPullRequestsRepository

type UserPullRequestsRepository struct {
	Name         string
	Description  string
	Url          string
	Watchers     int
	Stars        int
	Forks        int
	LangName     string
	LangColor    string
	PullRequests []*UserPullRequestsPullRequest
}

type UserRepositories

type UserRepositories struct {
	TotalCount   int
	Repositories []*UserRepository
}

type UserRepository

type UserRepository struct {
	Name               string
	Description        string
	Url                string
	Watchers           int
	Stars              int
	Forks              int
	LangName           string
	LangColor          string
	OpenedIssues       int
	OpenedPullRequests int
	License            string
	CreatedAt          time.Time
	PushedAt           time.Time
}

Jump to

Keyboard shortcuts

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