gh

package
v0.0.0-...-b58d5ac Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockClient

func MockClient(c Client)

func OAuthUrl

func OAuthUrl(code string) string

Build request to query github user oauth token

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

type Contributor

type Contributor struct {
	Login       string `json:"login"`
	ID          uint32 `json:"id"`
	AvatarUrl   string `json:"avatar_url"`
	WriteAccess bool   `json:"write_access"`
}

type GithubContext

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

func New

func New(token string) *GithubContext

func (*GithubContext) Get

func (ctx *GithubContext) Get(path string, a ...any) (*http.Response, error)

func (*GithubContext) Params

func (ctx *GithubContext) Params(p map[string]string) *GithubContext

type GithubUser

type GithubUser struct {
	// for db
	Login string `json:"login"`
	ID    uint64 `json:"id"`
	Email string `json:"email"`
	// for display
	Bio               string `json:"bio"`
	Name              string `json:"name"`
	AvatarURL         string `json:"avatar_url"`
	HTMLURL           string `json:"html_url"`
	PublicRepos       uint16 `json:"public_repos"`
	TotalPrivateRepos uint16 `json:"total_private_repos"`
	OwnedPrivateRepos uint16 `json:"owned_private_repos"`
	CreatedAt         string `json:"created_at"`
	UpdatedAt         string `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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