requests

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: BSD-3-Clause Imports: 10 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

func LoadLinguistLanguages added in v1.0.3

func LoadLinguistLanguages() (map[string]struct{ Name, Color string }, error)

func Request

func Request(token, query string, variables map[string]interface{}) (*http.Response, error)

Types

type Data

type Data struct {
	Viewer Viewer `json:"viewer"`
}

type DataUser

type DataUser struct {
	Viewer ViewerUser `json:"viewer"`
}

type GlobalStats added in v1.1.0

type GlobalStats struct {
	TotalStars   int
	TotalCommits int
	TotalPRs     int
	TotalIssues  int
	TotalReviews int
	MergedPRs    int
	Followers    int
	TotalRepos   int
	TotalForks   int
}

func FetchGlobalStats added in v1.1.0

func FetchGlobalStats(username, token string) (*GlobalStats, error)

type GlobalStatsResponse added in v1.1.0

type GlobalStatsResponse struct {
	Data struct {
		User struct {
			Followers struct {
				TotalCount int `json:"totalCount"`
			} `json:"followers"`
			Issues struct {
				TotalCount int `json:"totalCount"`
			} `json:"issues"`
			PullRequests struct {
				TotalCount int `json:"totalCount"`
			} `json:"pullRequests"`
			MergedPRs struct {
				TotalCount int `json:"totalCount"`
			} `json:"mergedPRs"`
			ContributionsCollection struct {
				TotalPullRequestReviewContributions int `json:"totalPullRequestReviewContributions"`
				TotalCommitContributions            int `json:"totalCommitContributions"`
			} `json:"contributionsCollection"`
			Repositories struct {
				TotalCount int `json:"totalCount"`
				Nodes      []struct {
					StargazerCount int `json:"stargazerCount"`
					ForkCount      int `json:"forkCount"`
				} `json:"nodes"`
			} `json:"repositories"`
		} `json:"user"`
	} `json:"data"`
}

type GraphQLPRFilesResponse added in v1.0.3

type GraphQLPRFilesResponse struct {
	Data struct {
		Node struct {
			Files PRFiles `json:"files"`
		} `json:"node"`
	} `json:"data"`
}

type GraphQLResponse

type GraphQLResponse struct {
	Data Data `json:"data"`
}

type GraphQLUserResponse

type GraphQLUserResponse struct {
	Data DataUser `json:"data"`
}

type HistoryResponse added in v1.1.0

type HistoryResponse struct {
	Data struct {
		User struct {
			CreatedAt string `json:"createdAt"`
		} `json:"user"`
	} `json:"data"`
}

type LanguageEdge

type LanguageEdge struct {
	Node LanguageNode `json:"node"`
	Size int          `json:"size"`
}

type LanguageNode

type LanguageNode struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

type Languages

type Languages struct {
	Edges []LanguageEdge `json:"edges"`
}

type LinguistLanguage added in v1.0.3

type LinguistLanguage struct {
	Color      string   `yaml:"color"`
	Extensions []string `yaml:"extensions"`
}

type OrganizationNode

type OrganizationNode struct {
	Login         string       `json:"login"`
	CanAdminister bool         `json:"viewerCanAdminister"`
	Repositories  Repositories `json:"repositories"`
}

type Organizations

type Organizations struct {
	Nodes    []OrganizationNode `json:"nodes"`
	PageInfo PageInfo           `json:"pageInfo"`
}

type PRFileNode added in v1.0.3

type PRFileNode struct {
	Path      string `json:"path"`
	Additions int    `json:"additions"`
}

type PRFiles added in v1.0.3

type PRFiles struct {
	Nodes    []PRFileNode `json:"nodes"`
	PageInfo PageInfo     `json:"pageInfo"`
}

type PRRepositoryDetail added in v1.0.3

type PRRepositoryDetail struct {
	Name          string `json:"name"`
	NameWithOwner string `json:"nameWithOwner"`
}

type PageInfo

type PageInfo struct {
	EndCursor       string `json:"endCursor"`
	StartCursor     string `json:"startCursor"`
	HasNextPage     bool   `json:"hasNextPage"`     // Example
	HasPreviousPage bool   `json:"hasPreviousPage"` // Example
}

type PrimaryLanguage

type PrimaryLanguage struct {
	Name string `json:"name"`
}

type Repositories

type Repositories struct {
	Edges []RepositoryEdge `json:"edges"`
}

type RepositoryEdge

type RepositoryEdge struct {
	Node RepositoryNode `json:"node"`
}

type RepositoryNode

type RepositoryNode struct {
	Name            string          `json:"name"`
	NameWithOwner   string          `json:"nameWithOwner"`
	PrimaryLanguage PrimaryLanguage `json:"primaryLanguage"`
	Languages       Languages       `json:"languages"`
}

type Result

type Result struct {
	Repositories []*ResultRepository
}

func FetchOrganizations

func FetchOrganizations(loginName, token string, ignored ...string) (*Result, error)

func FetchUser

func FetchUser(loginName, token string, withFork bool, ignored ...string) (*Result, error)

func FetchUserPRLanguages added in v1.0.3

func FetchUserPRLanguages(token string, extensionMap map[string]struct{ Name, Color string }, ignored ...string) (*Result, error)

type ResultLanguage

type ResultLanguage struct {
	Name  string
	Color string
	Size  int
}

type ResultRepository

type ResultRepository struct {
	Organization string
	Name         string
	Languages    []*ResultLanguage
	IsFork       bool
	IsPR         bool
	PRCount      int
}

type StreakStats added in v1.1.0

type StreakStats struct {
	TotalContributions int
	CurrentStreak      int
	LongestStreak      int
	AccountCreated     string
	CurrentStart       string
	CurrentEnd         string
	LongestStart       string
	LongestEnd         string
}

func FetchContributionStats added in v1.1.0

func FetchContributionStats(username, token string) (*StreakStats, error)

type UserPullRequestEdge added in v1.0.3

type UserPullRequestEdge struct {
	Node UserPullRequestNode `json:"node"`
}

type UserPullRequestNode added in v1.0.3

type UserPullRequestNode struct {
	ID         string             `json:"id"`
	Title      string             `json:"title"`
	Repository PRRepositoryDetail `json:"repository"`
	Files      PRFiles            `json:"files"`
}

type UserPullRequests added in v1.0.3

type UserPullRequests struct {
	Edges    []UserPullRequestEdge `json:"edges"`
	PageInfo PageInfo              `json:"pageInfo"`
}

type UserRepositories added in v1.0.3

type UserRepositories struct {
	Edges    []UserRepositoryEdge `json:"edges"`
	PageInfo PageInfo             `json:"pageInfo"`
}

type UserRepositoryEdge added in v1.0.3

type UserRepositoryEdge struct {
	Node UserRepositoryNode `json:"node"`
}

type UserRepositoryNode added in v1.0.3

type UserRepositoryNode struct {
	Name            string          `json:"name"`
	NameWithOwner   string          `json:"nameWithOwner"`
	IsFork          bool            `json:"isFork"`
	PrimaryLanguage PrimaryLanguage `json:"primaryLanguage"`
	Languages       Languages       `json:"languages"`
}

type Viewer

type Viewer struct {
	Organizations Organizations `json:"organizations"`
}

type ViewerUser

type ViewerUser struct {
	Repositories UserRepositories `json:"repositories"`
	PullRequests UserPullRequests `json:"pullRequests"`
}

type YearlyContributionResponse added in v1.1.0

type YearlyContributionResponse struct {
	Data struct {
		User struct {
			ContributionsCollection struct {
				ContributionCalendar struct {
					TotalContributions int `json:"totalContributions"`
					Weeks              []struct {
						ContributionDays []struct {
							ContributionCount int    `json:"contributionCount"`
							Date              string `json:"date"`
						} `json:"contributionDays"`
					} `json:"weeks"`
				} `json:"contributionCalendar"`
			} `json:"contributionsCollection"`
		} `json:"user"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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