debpkgapi

package
v0.0.0-...-41c7bbd Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDownloadLinks(suite, arch, packageName string) (links []string, err error)

func GetFile

func GetFile(targets []string, r io.ReadSeeker, w io.Writer) (int64, error)
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

func GetFileList(suite, arch, packageName string) (files []string, err error)
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

func SearchPackagesByFile(suite, arch, filename string) (packages []string, err error)
Example
packages, err := SearchPackagesByFile("buster", "armhf", "libQt5Gui.so.5")
fmt.Println(packages, err)
Output:

[libqt5gui5] <nil>

func SearchPackagesByName

func SearchPackagesByName(name string) (results []string, err error)
Example
packages, err := SearchPackagesByName("libpulse-mainloop-glib")
fmt.Println(packages, err)
Output:

[libpulse-mainloop-glib0 libpulse-mainloop-glib0-dbg libpulse-mainloop-glib0-dbgsym] <nil>

Types

This section is empty.

Jump to

Keyboard shortcuts

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