Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (ghClient *Client) GetDeveloper(ctx context.Context, username string) (model.Developer, error)
- func (ghClient *Client) GetIssues(ctx context.Context, owner, repo string, cursor *string, start, end *time.Time) ([]Issue, *string, error)
- func (ghClient *Client) GetLastCommit(ctx context.Context, fullName string) (*time.Time, *time.Time, error)
- func (ghClient *Client) GetMergedPrs(ctx context.Context, owner, repo string, cursor *string, start, end *time.Time) ([]Pr, *string, error)
- func (ghClient *Client) GetRepository(ctx context.Context, fullName string) (model.GhRepository, error)
- func (ghClient *Client) GetRepositoryForks(ctx context.Context, owner, repo string, cursor *string, start *time.Time, ...) ([]Fork, *string, error)
- func (ghClient *Client) GetRepositoryStars(ctx context.Context, owner, repo string, cursor *string, start *time.Time, ...) ([]Stargazer, *string, error)
- type Commit
- type CommitResponse
- type Fork
- type GraphQLResponse
- type Issue
- type Option
- type Pr
- type Stargazer
- type SyncHandler
- type TokenPool
Constants ¶
View Source
const GraphQLURL = "https://api.github.com/graphql"
Variables ¶
View Source
var ErrAccessBlocked = errors.New("repository access blocked")
View Source
var ErrNotFound = errors.New("not found on GitHub")
View Source
var ErrTokenNotAvailable = errors.New("all github tokens are not available")
View Source
var ErrTooManyRequests = errors.New("too many requests")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
TokenPool *TokenPool
}
func (*Client) GetDeveloper ¶
func (*Client) GetLastCommit ¶ added in v0.13.0
func (*Client) GetMergedPrs ¶ added in v0.10.0
func (*Client) GetRepository ¶
func (*Client) GetRepositoryForks ¶ added in v0.10.0
type CommitResponse ¶ added in v0.13.0
type GraphQLResponse ¶ added in v0.10.0
type GraphQLResponse struct {
Data struct {
Repository struct {
Stargazers struct {
Edges []struct {
StarredAt string `json:"starredAt"`
Node struct {
Login string `json:"login"`
} `json:"node"`
} `json:"edges"`
PageInfo struct {
EndCursor string `json:"endCursor"`
HasNextPage bool `json:"hasNextPage"`
} `json:"pageInfo"`
} `json:"stargazers"`
Issues struct {
Edges []struct {
Node struct {
Number int `json:"number"`
Title string `json:"title"`
Closed bool `json:"closed"`
ClosedAt string `json:"closedAt"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Author struct {
Login string `json:"login"`
} `json:"author"`
URL string `json:"url"`
} `json:"node"`
} `json:"edges"`
PageInfo struct {
EndCursor string `json:"endCursor"`
HasNextPage bool `json:"hasNextPage"`
} `json:"pageInfo"`
} `json:"issues"`
PullRequests struct {
Edges []struct {
Node struct {
Number int `json:"number"`
Title string `json:"title"`
MergedAt string `json:"mergedAt"`
Author struct {
Login string `json:"login"`
} `json:"author"`
URL string `json:"url"`
} `json:"node"`
} `json:"edges"`
PageInfo struct {
EndCursor string `json:"endCursor"`
HasNextPage bool `json:"hasNextPage"`
} `json:"pageInfo"`
} `json:"pullRequests"`
Forks struct {
Edges []struct {
Node struct {
Name string `json:"name"`
Owner struct {
Login string `json:"login"`
} `json:"owner"`
CreatedAt string `json:"createdAt"`
} `json:"node"`
} `json:"edges"`
PageInfo struct {
EndCursor string `json:"endCursor"`
HasNextPage bool `json:"hasNextPage"`
} `json:"pageInfo"`
} `json:"forks"`
} `json:"repository"`
} `json:"data"`
}
type Option ¶ added in v0.10.0
type Option func(tp *TokenPool)
func WithAllowEmptytoken ¶ added in v0.10.0
type SyncHandler ¶ added in v0.6.3
type SyncHandler struct {
// contains filtered or unexported fields
}
func NewSyncHandler ¶ added in v0.6.3
func NewSyncHandler(repositoryRepo *model.GhRepositoryRepo, developerRepo *model.DeveloperRepo, client *Client) *SyncHandler
type TokenPool ¶ added in v0.10.0
type TokenPool struct {
// contains filtered or unexported fields
}
func NewTokenPool ¶ added in v0.10.0
func (*TokenPool) EarliestReset ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.