github

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessBlocked = errors.New("repository access blocked")
View Source
var ErrNotFound = errors.New("not found on GitHub")

Functions

This section is empty.

Types

type Client

type Client struct {
	Token string // the personal acesss token, if set, the common rate limit is 5000 reqs/hour, otherwise, it will be 60 reqs/hour.
}

GitHub rest api client

func NewClient

func NewClient(token string) *Client

func (*Client) GetDeveloper

func (ghClient *Client) GetDeveloper(ctx context.Context, username string) (model.Developer, error)

func (*Client) GetRepository

func (ghClient *Client) GetRepository(ctx context.Context, fullName string) (model.GhRepository, error)

type SyncHandler added in v0.6.3

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

func NewSyncHandler added in v0.6.3

func NewSyncHandler(db database.DB, repositoryRepo *model.GhRepositoryRepo, developerRepo *model.DeveloperRepo, client *Client) *SyncHandler

func (*SyncHandler) Handle added in v0.6.3

func (s *SyncHandler) Handle(ctx context.Context, action string, opts ...any) error

Jump to

Keyboard shortcuts

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