27 lines
1.0 KiB
Go
27 lines
1.0 KiB
Go
package api
|
|
|
|
import (
|
|
"chfs-ng/internal/storage"
|
|
"net/http"
|
|
)
|
|
|
|
type Server struct{ Store storage.Storage }
|
|
|
|
func (s *Server) Handler() http.Handler {
|
|
mux := http.NewServeMux()
|
|
mux.HandleFunc("/chfs/files", s.files)
|
|
mux.HandleFunc("/chfs/newdir", s.newdir)
|
|
mux.HandleFunc("/chfs/rename", s.rename)
|
|
mux.HandleFunc("/chfs/rmfiles", s.remove)
|
|
mux.HandleFunc("/chfs/exist", s.exist)
|
|
mux.HandleFunc("/chfs/session", s.session)
|
|
return mux
|
|
}
|
|
func notImpl(w http.ResponseWriter) { http.Error(w, "not implemented", http.StatusNotImplemented) }
|
|
func (s *Server) files(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|
|
func (s *Server) newdir(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|
|
func (s *Server) rename(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|
|
func (s *Server) remove(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|
|
func (s *Server) exist(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|
|
func (s *Server) session(w http.ResponseWriter, r *http.Request) { notImpl(w) }
|