Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNatsMsg ¶
NewNatsMsg creates a NATS message.
func WriteJSONError ¶
func WriteJSONError(w http.ResponseWriter, statusCode int, message string)
WriteJSONError writes an error response as JSON.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
WriteJSONResponse writes a successful NATS response as JSON.
Types ¶
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error struct for JSON error responses.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides HTTP to NATS bridging.
func (*Handler) NatsHandler ¶
func (h *Handler) NatsHandler(w http.ResponseWriter, r *http.Request)
NatsHandler routes HTTP requests to appropriate handlers based on path prefixes.
Click to show internal directories.
Click to hide internal directories.