26 lines
499 B
Go
26 lines
499 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
// Declaring non-existing HTTP method
|
|
const (
|
|
MethodPurge = "PURGE"
|
|
VaultStgRoleId = ""
|
|
VaultStgSecretId = ""
|
|
)
|
|
|
|
// PurgeHandler handles PURGE request to broadcast it to all varnish instances
|
|
func PurgeHandler(w http.ResponseWriter, r *http.Request) {
|
|
url := r.URL.String()
|
|
io.WriteString(w, url)
|
|
}
|
|
|
|
func main() {
|
|
http.HandleFunc("/", PurgeHandler)
|
|
log.Fatal(http.ListenAndServe(":6081",nil))
|
|
}
|