github

package
v3.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github provides GitHub API v3 adaptor

Index

Constants

View Source
const (
	DefaultHost    = "github.com"
	DefaultAPIHost = "api.github.com"
)
View Source
const ClientID = "Ov23li6aEWIxek6F8P5L"

Variables

This section is empty.

Functions

func OAuth2Config

func OAuth2Config(host string) *oauth2.Config

Types

type AcceptedError

type AcceptedError = github.AcceptedError

type Adaptor

type Adaptor interface {
	GetAccessToken() (string, error)
	GetHost() string
	GetMe(ctx context.Context) (string, error)
	GetAuthenticatedUser(ctx context.Context) (*User, *Response, error)
	UserGet(ctx context.Context, user string) (*User, *Response, error)
	RepositoryList(
		ctx context.Context,
		opts *RepositoryListOptions,
	) ([]*RepositoryFragment, PageInfoFragment, error)
	RepositoryCreate(
		ctx context.Context,
		org string,
		repo *Repository,
	) (*Repository, *Response, error)
	RepositoryCreateFork(
		ctx context.Context,
		owner string,
		repo string,
		opts *RepositoryCreateForkOptions,
	) (*Repository, *Response, error)
	RepositoryCreateFromTemplate(
		ctx context.Context,
		templateOwner, templateRepo string,
		templateRepoReq *TemplateRepoRequest,
	) (*Repository, *Response, error)
	RepositoryDelete(ctx context.Context, owner string, repo string) (*Response, error)
	RepositoryGet(ctx context.Context, owner string, repo string) (*Repository, *Response, error)
	OrganizationList(ctx context.Context) ([]*Organization, *Response, error)
}

func NewAdaptor

func NewAdaptor(ctx context.Context, host string, token *Token) (Adaptor, error)

type ErrorResponse

type ErrorResponse = github.ErrorResponse

type LanguageFragment

type LanguageFragment = githubv4.LanguageFragment

type ListOptions

type ListOptions = github.ListOptions

type OrderDirection

type OrderDirection = githubv4.OrderDirection
const (
	OrderDirectionAsc  OrderDirection = githubv4.OrderDirectionAsc
	OrderDirectionDesc OrderDirection = githubv4.OrderDirectionDesc
)

type Organization added in v3.6.4

type Organization = github.Organization

type OwnerFragment

type OwnerFragment = githubv4.OwnerFragment

type PageInfoFragment

type PageInfoFragment = githubv4.PageInfoFragment

type ParentRepositoryFragment

type ParentRepositoryFragment = githubv4.ParentRepositoryFragment

type Repository

type Repository = github.Repository

type RepositoryAffiliation

type RepositoryAffiliation = githubv4.RepositoryAffiliation
const (
	RepositoryAffiliationOwner              RepositoryAffiliation = githubv4.RepositoryAffiliationOwner
	RepositoryAffiliationCollaborator       RepositoryAffiliation = githubv4.RepositoryAffiliationCollaborator
	RepositoryAffiliationOrganizationMember RepositoryAffiliation = githubv4.RepositoryAffiliationOrganizationMember
)

type RepositoryCreateForkOptions

type RepositoryCreateForkOptions = github.RepositoryCreateForkOptions

type RepositoryFragment

type RepositoryFragment = githubv4.RepositoryFragment

type RepositoryListOptions

type RepositoryListOptions struct {
	OrderBy           RepositoryOrder
	After             string
	Privacy           RepositoryPrivacy
	OwnerAffiliations []RepositoryAffiliation
	Limit             int
	IsFork            *bool
	IsArchived        *bool
}

type RepositoryOrder

type RepositoryOrder = githubv4.RepositoryOrder

type RepositoryPrivacy

type RepositoryPrivacy = githubv4.RepositoryPrivacy
const (
	RepositoryPrivacyPublic  RepositoryPrivacy = githubv4.RepositoryPrivacyPublic
	RepositoryPrivacyPrivate RepositoryPrivacy = githubv4.RepositoryPrivacyPrivate
)

type Response

type Response = github.Response

type TemplateRepoRequest

type TemplateRepoRequest = github.TemplateRepoRequest

type Token

type Token = oauth2.Token

type User

type User = github.User

Jump to

Keyboard shortcuts

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