MCPcopy Create free account
hub / github.com/facebook/time / NewAPI

Function NewAPI

calnex/api/api.go:573–587  ·  view source on GitHub ↗

NewAPI returns an pointer of API struct with default values.

(source string, insecureTLS bool, timeout time.Duration)

Source from the content-addressed store, hash-verified

571}
572
573// NewAPI returns an pointer of API struct with default values.
574func NewAPI(source string, insecureTLS bool, timeout time.Duration) (*API, error) {
575 host, err := formatHost(source)
576 if err != nil {
577 return nil, err
578 }
579 return &API{
580 Client: &http.Client{
581 Transport: &http.Transport{
582 TLSClientConfig: &tls.Config{InsecureSkipVerify: insecureTLS},
583 },
584 Timeout: timeout,
585 },
586 source: host,
587 }, nil
588}
589
590// FetchCsv takes channel name (like 1, 2, c, d)

Callers 15

TestGNSSFunction · 0.92
TestGNSSNoSatellitesFunction · 0.92
TestHTTPFunction · 0.92
TestPSUFunction · 0.92
TestPSUSingleBadFunction · 0.92
TestPSUBBadFunction · 0.92
TestModuleFunction · 0.92
TestModuleBadFunction · 0.92
TestFirmwareFunction · 0.92
TestFirmwareForceFunction · 0.92
TestFirmwareInProgressFunction · 0.92
TestRecoveryModeFunction · 0.92

Calls 1

formatHostFunction · 0.85

Tested by 15

TestGNSSFunction · 0.74
TestGNSSNoSatellitesFunction · 0.74
TestHTTPFunction · 0.74
TestPSUFunction · 0.74
TestPSUSingleBadFunction · 0.74
TestPSUBBadFunction · 0.74
TestModuleFunction · 0.74
TestModuleBadFunction · 0.74
TestFirmwareFunction · 0.74
TestFirmwareForceFunction · 0.74
TestFirmwareInProgressFunction · 0.74
TestRecoveryModeFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…