Documentation
¶
Index ¶
- type Handler
- func (h *Handler) Add(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Health(w http.ResponseWriter, r *http.Request)
- func (h *Handler) RegisterRoutes(mux *http.ServeMux)
- func (h *Handler) Retrieve(w http.ResponseWriter, r *http.Request)
- type Response
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles HTTP API requests
func NewHandler ¶
NewHandler creates a new HTTP handler
func (*Handler) Add ¶
func (h *Handler) Add(w http.ResponseWriter, r *http.Request)
Add handles POST /api/v1/memories/add
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
Delete handles DELETE /api/v1/memories/{id}
func (*Handler) Health ¶
func (h *Handler) Health(w http.ResponseWriter, r *http.Request)
Health handles GET /health
func (*Handler) RegisterRoutes ¶
RegisterRoutes registers all HTTP routes
type Response ¶
type Response struct {
Success bool `json:"success"`
Data any `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
Response represents a standard API response
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an HTTP server
func NewServer ¶
func NewServer(memory *action.Memory, config ServerConfig) *Server
NewServer creates a new HTTP server
type ServerConfig ¶
type ServerConfig struct {
Host string
Port int
ReadTimeout time.Duration
WriteTimeout time.Duration
}
ServerConfig contains HTTP server configuration
func DefaultServerConfig ¶
func DefaultServerConfig() ServerConfig
DefaultServerConfig returns default server configuration
Click to show internal directories.
Click to hide internal directories.