MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / getStreamInfo

Function getStreamInfo

src/system.go:364–392  ·  view source on GitHub ↗
(urlID string)

Source from the content-addressed store, hash-verified

362}
363
364func getStreamInfo(urlID string) (streamInfo StreamInfo, err error) {
365
366 if len(Data.Cache.StreamingURLS) == 0 {
367
368 tmp, err := loadJSONFileToMap(System.File.URLS)
369 if err != nil {
370 return streamInfo, err
371 }
372
373 err = json.Unmarshal([]byte(mapToJSON(tmp)), &Data.Cache.StreamingURLS)
374 if err != nil {
375 return streamInfo, err
376 }
377
378 }
379
380 if s, ok := Data.Cache.StreamingURLS[urlID]; ok {
381 s.URL = strings.Trim(s.URL, "\r\n")
382 s.BackupChannel1 = s.BackupChannel1
383 s.BackupChannel2 = s.BackupChannel2
384 s.BackupChannel3 = s.BackupChannel3
385
386 streamInfo = s
387 } else {
388 err = errors.New("streaming error")
389 }
390
391 return
392}
393
394func isRunningInContainer() bool {
395 if _, err := os.Stat("/.dockerenv"); err != nil {

Callers 1

StreamFunction · 0.85

Calls 2

loadJSONFileToMapFunction · 0.85
mapToJSONFunction · 0.70

Tested by

no test coverage detected