Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultSource = "https://registry.npmmirror.com/-/binary/node/" DefaultSourceType = Taobao )
Variables ¶
Functions ¶
func GetSortByVersion ¶
func IsVersionDir ¶
IsVersionDir verify name of a dir entry the version dir name should be vX.X.X or vX.X such as v1.17.1 or v1.17
func RegisterParser ¶
func RegisterParser(st SourceType, parser Parser)
Types ¶
type Parser ¶
type Parser interface { GerVersions(source string) ([]*Version, error) GetPackages(v *Version, os, arch string) ([]*Package, error) GetShaSumsMap(url string) (map[string]string, error) }
func LoadParser ¶
func LoadParser(st SourceType) Parser
type SourceType ¶
type SourceType string
SourceType source type of nodejs download url
const ( Unknown SourceType = "" // Standard e.g. https://nodejs.org/dist/ Standard SourceType = "standard" // Taobao e.g. https://registry.npmmirror.com/-/binary/node/ Taobao SourceType = "taobao" )
type StandardParser ¶
type StandardParser struct { }
func (*StandardParser) GerVersions ¶
func (p *StandardParser) GerVersions(source string) ([]*Version, error)
func (*StandardParser) GetPackages ¶
func (p *StandardParser) GetPackages(v *Version, os, arch string) ([]*Package, error)
func (*StandardParser) GetShaSumsMap ¶
func (p *StandardParser) GetShaSumsMap(url string) (map[string]string, error)
type TaobaoParser ¶
type TaobaoParser struct { }
func (*TaobaoParser) GerVersions ¶
func (p *TaobaoParser) GerVersions(source string) ([]*Version, error)
func (*TaobaoParser) GetPackages ¶
func (p *TaobaoParser) GetPackages(v *Version, os, arch string) ([]*Package, error)
func (*TaobaoParser) GetShaSumsMap ¶
func (p *TaobaoParser) GetShaSumsMap(sumsUrl string) (map[string]string, error)
Click to show internal directories.
Click to hide internal directories.