Documentation ¶
Index ¶
- func GetID(r *http.Request) (int, error)
- func HandleCreateTodo(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleCreateUser(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleDeleteTodo(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleGetTodo(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleGetTodoByID(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleGetUser(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleLogin(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleUpdateTodo(s APIServer, w http.ResponseWriter, r *http.Request) error
- func HandleUser(s APIServer, w http.ResponseWriter, r *http.Request) error
- func WriteJSON(w http.ResponseWriter, status int, v any) error
- type APIServer
- type ApiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleCreateTodo ¶
HandleCreateTodo handles the POST request for creating new todos
func HandleCreateUser ¶
func HandleDeleteTodo ¶
HandleDeleteTodo handles the DELETE request for deleting todos
func HandleGetTodo ¶
HandleGetTodo handles the GET request for fetching todos.
func HandleGetTodoByID ¶
HandleGetTodoByID handles the GET request for getting all the todos
func HandleGetUser ¶
func HandleLogin ¶
func HandleUpdateTodo ¶
HandleUpdateTodo handles the PATCH request for updating the todos
func HandleUser ¶
Types ¶
type APIServer ¶
APIServer represents the API server structure
func NewAPIServer ¶
NewAPIServer creates a new instance of APIServer
func (*APIServer) RegisterRoutes ¶
func (s *APIServer) RegisterRoutes()
RegisterRoutes starts the API server and listens for incoming requests.
Click to show internal directories.
Click to hide internal directories.