requests

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: BSD-3-Clause Imports: 9 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 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 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"`
	PageInfo PageInfo         `json:"pageInfo"`
}

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 ResultOrganizations

type ResultOrganizations struct {
	List      map[string][]string
	Languages map[string]int
}

type ResultRepository

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

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"`
}

Jump to

Keyboard shortcuts

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