ws

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(ctx context.Context, conn *websocket.Conn, msg Message) error

Types

type Message

type Message struct {
	ID        string             `json:"id,omitempty"`
	RequestID string             `json:"request_id,omitempty"`
	TS        time.Time          `json:"ts"`
	Kind      string             `json:"kind"`
	Items     []Task             `json:"items,omitempty"`
	IDs       []string           `json:"ids,omitempty"`
	Update    *system.UpdateV1_1 `json:"update,omitempty"`
	Hello     *system.HelloV1    `json:"hello,omitempty"`
	HelloAck  *system.HelloAckV1 `json:"hello_ack,omitempty"`
	LogChunk  *logs.LogChunk     `json:"log_chunk,omitempty"`

	TaskID    string      `json:"taskId,omitempty"`
	Success   bool        `json:"success,omitempty"`
	Data      interface{} `json:"data,omitempty"`
	TaskError *TaskError  `json:"error,omitempty"`
}

func Read

func Read(ctx context.Context, conn *websocket.Conn) (*Message, error)

type Task

type Task struct {
	ID      string          `json:"id"`
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload"`
	Status  string          `json:"status"`
	Created int64           `json:"createdAt"`
	Updated int64           `json:"updatedAt"`
}

type TaskError

type TaskError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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