mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-07 18:52:26 +00:00
Refactor server package structure and update error handling methods; remove unused dependencies
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package server_v1
|
||||
package v1
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
@@ -12,7 +12,9 @@ type ServerV1UtilsContract interface {
|
||||
extractDescriptionStatic(path string) (string, error)
|
||||
writeJSONError(status int, msg string)
|
||||
newUUID() string
|
||||
errNotFound()
|
||||
|
||||
_errNotFound()
|
||||
ErrNotFound(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
type ServerV1Contract interface {
|
||||
@@ -37,6 +39,10 @@ type HandlerV1 struct {
|
||||
listAllowedCmd *regexp.Regexp
|
||||
}
|
||||
|
||||
func InitV1Server(o *HandlerV1) *HandlerV1 {
|
||||
return o
|
||||
}
|
||||
|
||||
func (h *HandlerV1) Handle(w http.ResponseWriter, r *http.Request) {
|
||||
h.w = w
|
||||
h.r = r
|
||||
|
||||
Reference in New Issue
Block a user