github

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub struct {
	Initialized   bool // first call to github will get all stats by quotes and rate limits
	Client        http.Client
	GitHubStats   GitHubStats
	PersonalToken string
}

func NewGitHubClient

func NewGitHubClient() GitHub

func (*GitHub) Download

func (g *GitHub) Download(projectName string) ([]types.ReleaseNote, error)

func (*GitHub) HasRequestSlot

func (g *GitHub) HasRequestSlot() bool

func (*GitHub) SetPersonalToken

func (g *GitHub) SetPersonalToken(token string)

func (*GitHub) SyncStats

func (g *GitHub) SyncStats(resp *http.Response)

rate limit reset updated every ~hour

type GitHubStats

type GitHubStats struct {
	RateLimit         int   // X-RateLimit-Limit 		| 60 			| In units
	RateLimitRemaning int   // X-RateLimit-Remaining 	| 0 			| In units
	RateLimitReset    int64 // X-RateLimit-Reset 		| 1679179139 	| In seconds updated every ~hour
	RateLimitUsed     int   // X-RateLimit-Used 		| 60			| In units

	WaitSlotSeconds int // Seconds to reset RateLimit slots, if negative free to go
}

Jump to

Keyboard shortcuts

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