-
Notifications
You must be signed in to change notification settings - Fork 0
/
export_test.go
28 lines (24 loc) · 740 Bytes
/
export_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package gopensky
import (
"context"
"fmt"
"net/http"
)
var (
DecodeRawStateVector = decodeRawStateVector
DecodeWaypoint = decodeWaypoint
FloatToString = floatToString
GetFlightsRequestParams = getFlightsRequestParams
GetTracksRequestParams = getTracksRequestParams
GetStateRequestParams = getStateRequestParams
ParseFlightTrackResponse = parseFlightTrackResponse
OpenSkyAPIURL = openSkyAPIURL
NewConnectionError = newConnectionError
HandleError = handleError
)
func GetClient(ctx context.Context) (*http.Client, error) {
if c, ok := ctx.Value(clientKey).(*Connection); ok {
return c.client, nil
}
return nil, fmt.Errorf("%w %s", errContextKey, clientKey)
}