ws

package
v0.6.66 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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