main.go 454 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "net"
  4. "net/http"
  5. )
  6. func main() {
  7. l, err := net.Listen("unix", "/run/docker/plugins/plugin.sock")
  8. if err != nil {
  9. panic(err)
  10. }
  11. mux := http.NewServeMux()
  12. server := http.Server{
  13. Addr: l.Addr().String(),
  14. Handler: http.NewServeMux(),
  15. }
  16. mux.HandleFunc("/VolumeDriver.Create", func(w http.ResponseWriter, r *http.Request) {
  17. http.Error(w, "error during create", http.StatusInternalServerError)
  18. })
  19. server.Serve(l)
  20. }