this repo has no description
1package main 2 3import ( 4 "encoding/json" 5 "flag" 6 "fmt" 7 "io" 8 "log" 9 "net/http" 10) 11 12func main() { 13 endpoint := flag.String("internal-api", "http://localhost:5444", "Internal API endpoint") 14 repoguardPath := flag.String("repoguard-path", "/home/git/repoguard", "Path to the repoguard binary") 15 flag.Parse() 16 17 resp, err := http.Get(*endpoint + "/internal/allkeys") 18 if err != nil { 19 log.Fatalf("error fetching keys: %v", err) 20 } 21 defer resp.Body.Close() 22 23 body, err := io.ReadAll(resp.Body) 24 if err != nil { 25 log.Fatalf("error reading response body: %v", err) 26 } 27 28 var data map[string]string 29 err = json.Unmarshal(body, &data) 30 if err != nil { 31 log.Fatalf("error unmarshalling response body: %v", err) 32 } 33 34 fmt.Print(formatKeyData(*repoguardPath, data)) 35}