handler

package
v0.0.0-...-c20d9b3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckResponse

type AckResponse struct {
	ID      string `json:"id"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

type FileUpdateData

type FileUpdateData struct {
	ID            string `json:"id"`
	FilePath      string `json:"filePath"`
	Hash          string `json:"hash"`
	Event         string `json:"event"`
	Content       string `json:"content,omitempty"`
	PreviousHash  string `json:"previousHash,omitempty"`
	Timestamp     int64  `json:"timestamp"`
	ApiKey        string `json:"apiKey,omitempty"`
	WorkspacePath string `json:"workspacePath,omitempty"`
}

type HeartbeatData

type HeartbeatData struct {
	Type      string `json:"type"`
	Timestamp int64  `json:"timestamp"`
	ClientID  string `json:"clientId"`
}

type SocketHandler

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

func NewSocketHandler

func NewSocketHandler(config *config.Config, logger *slog.Logger, workspaceService domain.WorkspaceFileUsecase, workspaceUsecase domain.WorkspaceUsecase, userService domain.UserUsecase) (*SocketHandler, error)

func (*SocketHandler) BroadcastServerStatus

func (h *SocketHandler) BroadcastServerStatus(status, message string)

BroadcastServerStatus 向所有连接的客户端广播服务器状态

func (*SocketHandler) GetConnectedClients

func (h *SocketHandler) GetConnectedClients() int

GetConnectedClients 获取连接的客户端数量

func (*SocketHandler) GetServer

func (h *SocketHandler) GetServer() *socketio.Io

GetServer 返回Socket.IO服务器实例

type TestPingData

type TestPingData struct {
	Timestamp int64  `json:"timestamp"`
	Message   string `json:"message"`
	SocketID  string `json:"socketId"`
}

Jump to

Keyboard shortcuts

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