github

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package github provides GitHub API v3 adaptor

Index

Constants

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

Variables

This section is empty.

Functions

func NewAuthClient

func NewAuthClient(ctx context.Context, accessToken string) *http.Client

Types

type AcceptedError

type AcceptedError = github.AcceptedError

type Adaptor

type Adaptor interface {
	GetHost() string
	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)
}

func NewAdaptor

func NewAdaptor(ctx context.Context, host, token string, options ...Option) (Adaptor, error)

type ErrorResponse added in v2.1.5

type ErrorResponse = github.ErrorResponse

type LanguageFragment added in v2.2.0

type LanguageFragment = githubv4.LanguageFragment

type ListOptions

type ListOptions = github.ListOptions

type Option

type Option func(baseRESTURL *url.URL, uploadRESTURL *url.URL, baseGQLURL *url.URL)

func WithScheme

func WithScheme(scheme string) Option

type OrderDirection added in v2.2.0

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

type OwnerFragment added in v2.2.0

type OwnerFragment = githubv4.OwnerFragment

type PageInfoFragment added in v2.2.0

type PageInfoFragment = githubv4.PageInfoFragment

type ParentRepositoryFragment added in v2.2.0

type ParentRepositoryFragment = githubv4.ParentRepositoryFragment

type Repository

type Repository = github.Repository

type RepositoryAffiliation added in v2.2.0

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 added in v2.2.0

type RepositoryFragment = githubv4.RepositoryFragment

type RepositoryListOptions

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

type RepositoryOrder added in v2.2.0

type RepositoryOrder = githubv4.RepositoryOrder

type RepositoryOrderField added in v2.2.0

type RepositoryOrderField = githubv4.RepositoryOrderField

type RepositoryPrivacy added in v2.2.0

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

type Response

type Response = github.Response

type TemplateRepoRequest added in v2.1.4

type TemplateRepoRequest = github.TemplateRepoRequest

type User

type User = github.User

Jump to

Keyboard shortcuts

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