github

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalHost    = "github.com"
	GlobalAPIHost = "api.github.com"

	ClientID = "Ov23li6aEWIxek6F8P5L"
)
View Source
const (
	RepoListMaxLimitPerPage = 100
)

Variables

View Source
var ErrTokenNotFound = errors.New("no token found")

Functions

This section is empty.

Types

type AuthenticateService

type AuthenticateService struct{}

func NewAuthenticateService

func NewAuthenticateService() *AuthenticateService

func (*AuthenticateService) Authenticate

func (s *AuthenticateService) Authenticate(ctx context.Context, host string, verify auth.Verify) (string, *Token, error)

type HostingService

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

func NewHostingService

func NewHostingService(tokenService auth.TokenService, defaultNameService repository.DefaultNameService) *HostingService

NewHostingService creates a new HostingService instance

func (*HostingService) CreateRepository

func (*HostingService) DeleteRepository

func (s *HostingService) DeleteRepository(ctx context.Context, reference repository.Reference) error

DeleteRepository deletes a repository from a remote source

func (*HostingService) ForkRepository

ForkRepository implements hosting.HostingService.

func (*HostingService) GetRepository

func (s *HostingService) GetRepository(ctx context.Context, reference repository.Reference) (*hosting.Repository, error)

GetRepository retrieves repository information from a remote source

func (*HostingService) GetTokenFor

func (s *HostingService) GetTokenFor(ctx context.Context, host, owner string) (string, auth.Token, error)

GetTokenFor cache requested token for the host and owner

func (*HostingService) GetURLOf

func (s *HostingService) GetURLOf(ref repository.Reference) (*url.URL, error)

GetURLOf implements hosting.HostingService.

func (*HostingService) ListRepository

ListRepository retrieves a list of repositories from a remote source

func (*HostingService) ParseURL

func (s *HostingService) ParseURL(u *url.URL) (*repository.Reference, error)

ParseURL implements hosting.HostingService.

type Token

type Token = oauth2.Token

Jump to

Keyboard shortcuts

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