fetcher

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AWESOMECACHEFOLDER = ".awesomecache"
View Source
const AWESOMEREPOURL = "https://github.com/sindresorhus/awesome"
View Source
const DOWNLOAD_CONCURRENCY = 4
View Source
const RAWGITHUBUSERCONTENT = "https://raw.githubusercontent.com"

Variables

View Source
var BRANCHES = []string{"/master/", "/main/"}
View Source
var README_PATTERNS = []string{
	"README",
	"README.MD",
	"README.md",
	"readme",
	"readme.md",
	"readme.MD",
}

Functions

func CacheFileExists

func CacheFileExists(filename string) bool

func CacheFileName

func CacheFileName(url string) string

func CacheFileUptoDate

func CacheFileUptoDate(filename string) bool

func CacheFolderExists

func CacheFolderExists() bool

func CreateCacheFolder

func CreateCacheFolder() bool

func FetchAwesomeRepo added in v0.7.2

func FetchAwesomeRepo(repourl string) (string, error)

func FetchAwesomeRootRepo added in v0.7.2

func FetchAwesomeRootRepo() (string, error)

func GetCacheFolderPath

func GetCacheFolderPath() string

func GetCachePath

func GetCachePath(url string) string

func GetPossibleReadmeFileURLs

func GetPossibleReadmeFileURLs(repourl string) []string

func IsOlderThanOneDay

func IsOlderThanOneDay(t time.Time) bool

func IsUrl added in v0.2.0

func IsUrl(str string) bool

func PadLeft

func PadLeft(str, pad string, lenght int) string

func SaveCache

func SaveCache(filename string, text string) string

Types

type FetchError added in v0.7.2

type FetchError struct {
	URL     string
	Wrapped error
}

func (FetchError) Error added in v0.7.2

func (e FetchError) Error() string

func (FetchError) Unwrap added in v0.7.2

func (e FetchError) Unwrap() error

type MultiError added in v0.7.2

type MultiError struct {
	Errors []error
}

func (MultiError) Error added in v0.7.2

func (e MultiError) Error() string

type Progress added in v0.7.2

type Progress struct {
	Found   uint64
	Crawled uint64
	Errors  uint64
}

func FetchAllRepos added in v0.7.2

func FetchAllRepos(update chan Progress) (Progress, error)

Jump to

Keyboard shortcuts

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