MCPcopy
hub / github.com/wavetermdev/waveterm / MarshalJSON

Method MarshalJSON

pkg/waveobj/wtype.go:57–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57func (update WaveObjUpdate) MarshalJSON() ([]byte, error) {
58 rtn := make(map[string]any)
59 rtn["updatetype"] = update.UpdateType
60 rtn["otype"] = update.OType
61 rtn["oid"] = update.OID
62 if update.Obj != nil {
63 var err error
64 rtn["obj"], err = ToJsonMap(update.Obj)
65 if err != nil {
66 return nil, err
67 }
68 }
69 return json.Marshal(rtn)
70}
71
72func MakeUpdate(obj WaveObj) WaveObjUpdate {
73 return WaveObjUpdate{

Callers

nothing calls this directly

Calls 1

ToJsonMapFunction · 0.85

Tested by

no test coverage detected