Documentation
¶
Overview ¶
Package ws implements the WebSocket client for Flashduty communication.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Labels() []string
- func (c *Client) Name() string
- func (c *Client) Run(ctx context.Context) error
- func (c *Client) RunWithReconnect(ctx context.Context) error
- func (c *Client) Send(msg *protocol.Message) error
- func (c *Client) SendPayload(msgType protocol.MessageType, payload any) error
- func (c *Client) WorknodeID() string
- type Handler
- type MessageHandler
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 is the WebSocket client for Flashduty communication.
func NewClient ¶
func NewClient(token, apiURL, workspaceRoot string, handler MessageHandler, version string) *Client
NewClient creates a new WebSocket client.
func (*Client) RunWithReconnect ¶
RunWithReconnect runs the client with automatic reconnection.
func (*Client) SendPayload ¶
func (c *Client) SendPayload(msgType protocol.MessageType, payload any) error
SendPayload sends a message with the given type and payload.
func (*Client) WorknodeID ¶
WorknodeID returns the worknode ID assigned by Flashduty.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles incoming WebSocket messages.
func NewHandler ¶
NewHandler creates a new message handler.
func (*Handler) CancelAllTasks ¶
func (h *Handler) CancelAllTasks()
CancelAllTasks cancels all running tasks.
func (*Handler) RunningTaskCount ¶
RunningTaskCount returns the number of running tasks.
Click to show internal directories.
Click to hide internal directories.