webui

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

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 Notification struct {
	ID        string                 `json:"id"`
	Title     string                 `json:"title"`
	Body      string                 `json:"body"`
	Data      map[string]interface{} `json:"data"`
	CreatedAt time.Time              `json:"createdAt"`
	Delivered bool                   `json:"delivered"`
}

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 NewServer

func NewServer(cfg *config.Config, agentLoop *agent.AgentLoop, cronService *cron.Service, registry *channels.Registry) *Server

func (*Server) AddNotification

func (s *Server) AddNotification(title, body string, data map[string]interface{}) string

AddNotification adds a notification to the store

func (*Server) Start

func (s *Server) Start(ctx context.Context, host string, port int) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type ServerReference

type ServerReference struct {
	// contains filtered or unexported fields
}

ServerReference 用于访问 Server 方法(在 handleWebSocket 中设置)

type UploadResponse

type UploadResponse struct {
	ID       string `json:"id"`
	Filename string `json:"filename"`
	Size     int64  `json:"size"`
	URL      string `json:"url"`
	Path     string `json:"path"`
}

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

func (*WebSocketHub) Run

func (h *WebSocketHub) Run()

Run starts the WebSocket hub event loop

type WebSocketMessageType

type WebSocketMessageType string

WebSocketMessageType 消息类型

const (
	WSMessageTypeChat      WebSocketMessageType = "chat"
	WSMessageTypeInterrupt WebSocketMessageType = "interrupt"
	WSMessageTypeStream    WebSocketMessageType = "stream"
	WSMessageTypeStatus    WebSocketMessageType = "status"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL