util

package
v0.0.0-...-d2170fd Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CDNJS_AJAX_URL = "http://cdnjs.cloudflare.com/ajax/libs"
View Source
const CDNJS_API_URL = "https://api.cdnjs.com/libraries"

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(filename, url string) error

DownloadFile - download one file to current folder

func DownloadFileWithVersion

func DownloadFileWithVersion(name, version string)

DownloadFileWithVersion - download the files with specific version, latest version default

func GenerateLink(lib, ver, file string) string

GenerateLink - Generate download link of the lib

func PackageTagWithVersion

func PackageTagWithVersion(name, version string) []string

PackageTagWithVersion - get lib tag with specific version , latest version default

func PackageURLWithVersion

func PackageURLWithVersion(name, version string) []string

PackageURLWithVersion - get the urls with specific version, latest version default

func Version

func Version() string

Version - return version of this soft

Types

type Assets

type Assets struct {
	Version string
	Files   []string
}

type Package

type Package struct {
	Name         string
	FileName     string
	Version      string
	Description  string
	Homepage     string
	Keywords     []string
	Licence      string
	Repositories []Repositories
	Assets       []Assets
}

func InfoPackage

func InfoPackage(name string) Package

InfoPackage - get info of one lib

func (Package) PrintAsJSON

func (p Package) PrintAsJSON()

func (Package) Short

func (p Package) Short()

type Repositories

type Repositories struct {
	Type string
	URL  string
}

type SearchPackage

type SearchPackage struct {
	Name   string `json:"name"`
	Latest string `json:"latest"`
}

type SearchResults

type SearchResults struct {
	Results []SearchPackage `json:"results"`
}

func SearchWithName

func SearchWithName(name string) SearchResults

SearchWithName - search libs with lib names

func (SearchResults) PrintAsTable

func (sr SearchResults) PrintAsTable(num int)

Jump to

Keyboard shortcuts

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