MCPcopy Index your code
hub / github.com/Monibuca/engine / MarshalJSON

Method MarshalJSON

stream.go:179–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179func (tracks *Tracks) MarshalJSON() ([]byte, error) {
180 var trackList []common.Track
181 tracks.marshalLock.Lock()
182 defer tracks.marshalLock.Unlock()
183 tracks.Range(func(_ string, t common.Track) {
184 t.SnapForJson()
185 trackList = append(trackList, t)
186 })
187 return json.Marshal(trackList)
188}
189
190var streamIdGen atomic.Uint32
191

Callers

nothing calls this directly

Calls 5

RangeMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
SnapForJsonMethod · 0.65
MarshalMethod · 0.65

Tested by

no test coverage detected