Documentation
¶
Index ¶
- Constants
- type HTTPRequest
- type HTTPResponse
- type Manager
- func (m *Manager) Handler() http.Handler
- func (m *Manager) NonStream(ctx context.Context, provider string, req *HTTPRequest) (*HTTPResponse, error)
- func (m *Manager) Path() string
- func (m *Manager) Send(ctx context.Context, provider string, msg Message) (<-chan Message, error)
- func (m *Manager) Stop(_ context.Context) error
- func (m *Manager) Stream(ctx context.Context, provider string, req *HTTPRequest) (<-chan StreamEvent, error)
- type Message
- type Options
- type StreamEvent
Constants ¶
View Source
const ( MessageTypeHTTPReq = "http_request" MessageTypeHTTPResp = "http_response" MessageTypeStreamStart = "stream_start" MessageTypeStreamChunk = "stream_chunk" MessageTypeStreamEnd = "stream_end" MessageTypeError = "error" MessageTypePing = "ping" MessageTypePong = "pong" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPRequest ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) NonStream ¶
func (m *Manager) NonStream(ctx context.Context, provider string, req *HTTPRequest) (*HTTPResponse, error)
func (*Manager) Stream ¶
func (m *Manager) Stream(ctx context.Context, provider string, req *HTTPRequest) (<-chan StreamEvent, error)
type Message ¶
type Message struct {
ID string `json:"id"`
Type string `json:"type"`
Payload map[string]any `json:"payload,omitempty"`
}
Message represents the JSON payload exchanged with websocket clients.
Click to show internal directories.
Click to hide internal directories.