chore: bootstrap CHFS NG workspace

This commit is contained in:
chfs-ng
2026-09-21 12:58:08 +08:00
commit 83695cea81
14 changed files with 263 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
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) }