ready to make a map, sort and compare

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-12 04:44:36 -06:00
parent 83ad552401
commit 0be507b896
4 changed files with 46 additions and 2 deletions

View File

@ -3,7 +3,7 @@ all:
go build -v -x
sudo setcap 'cap_net_bind_service=+ep' go.wit.com
./go.wit.com
# ./myrepos >/tmp/myrepos.stderr 2>&1
@# ./myrepos >/tmp/myrepos.stderr 2>&1
redomod:
rm -f go.*

23
files/repomap Normal file
View File

@ -0,0 +1,23 @@
go.wit.com/log git.wit.org/wit/log
go.wit.com/gui git.wit.org/gui/
go.wit.com/gui/gui git.wit.org/gui/gui
go.wit.com/gui/widget git.wit.org/gui/widget
go.wit.com/gui/toolkits git.wit.org/gui/toolkits
go.wit.com/gui/debugger git.wit.org/gui/debugger
go.wit.com/gui/gadgets git.wit.org/gui/gadgets
go.wit.com/gui/digitalocean git.wit.org/gui/digitalocean
go.wit.com/gui/cloudflare git.wit.org/gui/cloudflare
go.wit.com/apps/control-panel-dns git.wit.org/jcarr/control-panel-dns
go.wit.com/apps/control-panel-digitalocean git.wit.org/wit/control-panel-digitalocean
go.wit.com/apps/control-panel-cloudflare git.wit.org/wit/control-panel-cloudflare
go.wit.com/apps/control-panel-vpn git.wit.org/wit/control-panel-vpn
go.wit.com/apps/myrepos git.wit.org/jcarr/myrepos
go.wit.com/apps/go.wit.com git.wit.org/jcarr/go.wit.com
go.wit.com/dev/alexflint/go-arg/ git.wit.org/wit/go-arg
go.wit.com/shell
git.wit.org/wit/wit-debian-gui/
git.wit.org/jcarr/wit-new-machine
git.wit.org/jcarr/personal-gui

View File

@ -56,6 +56,8 @@ func main() {
return
}
*/
readconfigfile()
return
http.HandleFunc("/", okHandler)
err := http.ListenAndServe(":80", nil)
if err != nil {

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
// "log"
"strings"
"go.wit.com/log"
"net/http"
)
@ -46,3 +47,21 @@ func doGui(w http.ResponseWriter, path string) {
fmt.Fprintln(w, "OK")
*/
}
func readconfigfile() {
pfile, err := htmlFiles.ReadFile("files/repomap")
if err != nil {
log.Error(err, "missing repomap in the binary")
return
}
lines := strings.Split(string(pfile), "\n")
for _, line := range lines {
fields := strings.Fields(line)
if (len(fields) < 2) {
continue
}
repo := fields[0]
realurl := fields[1]
log.Info("repo =", repo, "real url =", realurl)
}
}