MCPcopy Index your code
hub / github.com/screego/server / ToTypedOutgoing

Function ToTypedOutgoing

ws/readwrite.go:17–26  ·  view source on GitHub ↗
(outgoing outgoing.Message)

Source from the content-addressed store, hash-verified

15}
16
17func ToTypedOutgoing(outgoing outgoing.Message) (Typed, error) {
18 payload, err := json.Marshal(outgoing)
19 if err != nil {
20 return Typed{}, err
21 }
22 return Typed{
23 Type: outgoing.Type(),
24 Payload: payload,
25 }, nil
26}
27
28func ReadTypedIncoming(r io.Reader) (Event, error) {
29 typed := Typed{}

Callers 1

startWriteHandlerMethod · 0.85

Calls 1

TypeMethod · 0.65

Tested by

no test coverage detected