Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a WebSocket client
type Notification ¶
type NotificationStore ¶
type NotificationStore struct {
// contains filtered or unexported fields
}
func NewNotificationStore ¶
func NewNotificationStore() *NotificationStore
func (*NotificationStore) Add ¶
func (s *NotificationStore) Add(title, body string, data map[string]interface{}) string
func (*NotificationStore) GetPending ¶
func (s *NotificationStore) GetPending() []Notification
func (*NotificationStore) MarkDelivered ¶
func (s *NotificationStore) MarkDelivered(id string)
type ProviderTestRequest ¶
type ProviderTestRequest struct {
Name string `json:"name"`
APIKey string `json:"apiKey"`
BaseURL string `json:"baseURL,omitempty"`
APIFormat string `json:"apiFormat"`
}
ProviderTestRequest represents a provider test request
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddNotification ¶
AddNotification adds a notification to the store
type ServerReference ¶
type ServerReference struct {
// contains filtered or unexported fields
}
ServerReference 用于访问 Server 方法(在 handleWebSocket 中设置)
type UploadResponse ¶
type WSMessage ¶
type WSMessage struct {
Type WebSocketMessageType `json:"type"`
Session string `json:"session,omitempty"`
Content string `json:"content,omitempty"`
Mode string `json:"mode,omitempty"` // "cancel" | "append"
Timestamp int64 `json:"timestamp,omitempty"`
}
WSMessage WebSocket 消息结构
type WebSocketHub ¶
type WebSocketHub struct {
// contains filtered or unexported fields
}
WebSocketHub manages WebSocket connections
func NewWebSocketHub ¶
func NewWebSocketHub() *WebSocketHub
NewWebSocketHub creates a new WebSocket hub
func (*WebSocketHub) Broadcast ¶
func (h *WebSocketHub) Broadcast(messageType string, payload interface{})
Broadcast sends a message to all connected clients
type WebSocketMessageType ¶
type WebSocketMessageType string
WebSocketMessageType 消息类型
const ( WSMessageTypeChat WebSocketMessageType = "chat" WSMessageTypeInterrupt WebSocketMessageType = "interrupt" WSMessageTypeStream WebSocketMessageType = "stream" WSMessageTypeStatus WebSocketMessageType = "status" )
Click to show internal directories.
Click to hide internal directories.