Documentation ¶
Index ¶
- func GetDownloadLinks(suite, arch, packageName string) (links []string, err error)
- func GetFile(targets []string, r io.ReadSeeker, w io.Writer) (int64, error)
- func GetFileList(suite, arch, packageName string) (files []string, err error)
- func SearchPackagesByFile(suite, arch, filename string) (packages []string, err error)
- func SearchPackagesByName(name string) (results []string, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDownloadLinks ¶
Example ¶
links, _ := GetDownloadLinks("buster", "armhf", "libavcodec58") for _, link := range links { if strings.Contains(link, "ftp.debian.org") { fmt.Println(link) } }
Output: http://ftp.debian.org/debian/pool/main/f/ffmpeg/libavcodec58_4.1.6-1~deb10u1_armhf.deb
func GetFile ¶
Example ¶
links, _ := GetDownloadLinks("buster", "armhf", "libwrap0") var dllink string for _, link := range links { if strings.Contains(link, "ftp.debian.org") { dllink = link } } resp, err := http.Get(dllink) if err != nil { return } b, err := ioutil.ReadAll(resp.Body) if err != nil { return } resp.Body.Close() br := bytes.NewReader(b) var buf bytes.Buffer GetFile([]string{"README.Debian"}, br, &buf) str := buf.String() fmt.Println(str[0:strings.Index(str, "\n")])
Output: tcp_wrappers for Debian
func GetFileList ¶
Example ¶
files, _ := GetFileList("buster", "armhf", "libavcodec58") fmt.Println(strings.Join(files, "\n"))
Output: /usr/lib/arm-linux-gnueabihf/libavcodec.so.58 /usr/lib/arm-linux-gnueabihf/libavcodec.so.58.35.100 /usr/share/doc/libavcodec58/changelog.Debian.gz /usr/share/doc/libavcodec58/changelog.gz /usr/share/doc/libavcodec58/copyright /usr/share/lintian/overrides/libavcodec58
func SearchPackagesByFile ¶
Example ¶
packages, err := SearchPackagesByFile("buster", "armhf", "libQt5Gui.so.5") fmt.Println(packages, err)
Output: [libqt5gui5] <nil>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.