github

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BASE_API_URL       = "https://api.github.com"
	BASE_URL           = "https://github.com"
	BETA_ACCEPT_HEADER = "application/vnd.github.machine-man-preview+json"
	V3_ACCEPT_HEADER   = "application/vnd.github.v3.raw"
)

Functions

This section is empty.

Types

type GithubInterface

type GithubInterface interface {
	GetListRepos(page int32, installationId, userAccessToken string) (*GithubRepositories, error)
	GetUserInformation(userAccessToken string) (*GithubUserInfo, error)
	CreateGithubAppToken(installationId string) (string, error)
	GetUserAccessToken(code string) (string, error)
	GetFile(organization, repository, branch, file, userAccessToken string) (string, error)
}

func New

func New(appClientID, appClientSecret string) GithubInterface

type GithubRepositories

type GithubRepositories struct {
	Repositories []GithubRepository `json:"repositories"`
	TotalCount   int                `json:"total_count"`
}

type GithubRepository

type GithubRepository struct {
	CloneURL      string `json:"clone_url"`
	Private       bool   `json:"private"`
	DefaultBranch string `json:"default_branch"`
}

type GithubUserInfo

type GithubUserInfo struct {
	Email    string `json:"email"`
	Username string `json:"login"`
}

Jump to

Keyboard shortcuts

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