MCPcopy Index your code
hub / github.com/coder/coder / NewDecoder

Function NewDecoder

codersdk/wsjson/decoder.go:74–77  ·  view source on GitHub ↗

NewDecoder creates a JSON-over-websocket decoder for type T, which must be deserializable from JSON.

(conn *websocket.Conn, typ websocket.MessageType, logger slog.Logger)

Source from the content-addressed store, hash-verified

72// NewDecoder creates a JSON-over-websocket decoder for type T, which must be deserializable from
73// JSON.
74func NewDecoder[T any](conn *websocket.Conn, typ websocket.MessageType, logger slog.Logger) *Decoder[T] {
75 ctx, cancel := context.WithCancel(context.Background())
76 return &Decoder[T]{conn: conn, ctx: ctx, cancel: cancel, typ: typ, logger: logger}
77}

Callers 5

TestWatchChatGitFunction · 0.92
TestWatchAgentContainersFunction · 0.92
DialMethod · 0.92
WatchContainersMethod · 0.92

Calls

no outgoing calls

Tested by 3

TestWatchChatGitFunction · 0.74
TestWatchAgentContainersFunction · 0.74
DialMethod · 0.74