Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeByteResponse ¶
func EncodeByteResponse(w http.ResponseWriter, statusCode int, resp []byte)
func EncodeResponse ¶
func EncodeResponse(w http.ResponseWriter, statusCode int, resp any)
Types ¶
type SSEErrCode ¶
type SSEErrCode string
const (
InternalServiceErr SSEErrCode = "INTERNAL_SERVER_ERROR"
)
type SSEErrorData ¶
type SSEErrorData struct {
Code SSEErrCode `json:"code"`
Message string `json:"message,omitempty"`
}
type SSEEvent ¶
func NewErrorEvent ¶
type SSEStream ¶
type SSEStream struct {
// contains filtered or unexported fields
}
func NewSSEStream ¶
func (*SSEStream) SendError ¶
func (s *SSEStream) SendError(event SSEErrorData)
Click to show internal directories.
Click to hide internal directories.