refresh endpoint

This commit is contained in:
2026-04-15 13:29:19 -06:00
parent b641e3c803
commit 531df3ab2f
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -4,6 +4,11 @@ type Config struct {
MirrorRoot string
MirrorURL string
Port string
Auth AuthConfig
}
type AuthConfig struct {
Token string
}
func NewConfig() *Config {
@@ -11,5 +16,6 @@ func NewConfig() *Config {
MirrorRoot: "/home/ewpt3ch/dev/pacman-cache-server/tmprepo",
MirrorURL: "https://us.mirrors.cicku.me/archlinux/",
Port: "8090",
Auth: AuthConfig{Token: "FakeToken"},
}
}
+1
View File
@@ -19,6 +19,7 @@ func main() {
mux := http.NewServeMux()
mux.HandleFunc("GET /{repo}/os/{arch}/{file}", srv.handlePackage)
mux.HandleFunc("POST /api/refresh", srv.handlerRefresh)
if err := srv.c.Refresh(); err != nil {
log.Fatal(err)