core

package
v0.0.0-...-702d682 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RateLimitUrl = "https://api.github.com/rate_limit"

Variables

This section is empty.

Functions

func CheckRateLimit

func CheckRateLimit(token string, args ...any) error

func GetStars

func GetStars(links []contract.Link, puller contract.Puller) map[string]int

func NewHandler

func NewHandler(puller contract.Puller, readmePath string, url string) contract.Handler
func NewLink(title, url, raw string) contract.Link

func NewPullResult

func NewPullResult(statusCode int, content []byte) contract.PullResult

func NewPuller

func NewPuller(token string) contract.Puller

func Parse

func Parse(content string) []contract.Link

func Replace

func Replace(scanner *bufio.Scanner, stars map[string]int) (string, error)

Types

type GithubResponse

type GithubResponse struct {
	StargazersCount int `json:"stargazers_count"`
}

type RateLimitResponse

type RateLimitResponse struct {
	Rate struct {
		Limit     int `json:"limit"`
		Remaining int `json:"remaining"`
		Reset     int `json:"reset"`
		Used      int `json:"used"`
	} `json:"rate"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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