checking in net - i'll have to finish it later, but i'm getting there.

This commit is contained in:
2021-02-24 00:48:41 -05:00
parent bb786855fc
commit 55ac47c869
14 changed files with 15136 additions and 0 deletions

31
net/genfuncs.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"bytes"
"io"
"net/http"
"r00t2.io/sysutils/net/ports"
)
func download(url string) (b *[]byte, err error) {
var resp *http.Response
var buf bytes.Buffer
b = &[]byte{}
if resp, err = http.Get(url); err != nil {
return
}
defer resp.Body.Close()
if _, err = io.Copy(&buf, resp.Body); err != nil {
return
}
*b = buf.Bytes()
return
}
func (ports *PortSet) parse(src *[]byte, outBytes *[]byte)