-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathunmarshal.go
49 lines (43 loc) · 1.05 KB
/
unmarshal.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package usgs
import (
"github.com/mattn/go-nulltype"
"github.com/whitewater-guide/gorge/core"
)
const (
paramFlow = "00060" // Discharge, cubic feet per second
paramLevel = "00065" // Gage height, feet
)
type ivRoot struct {
Value ivRootValue `json:"value"`
}
type ivRootValue struct {
TimeSeries []timeSeries `json:"timeSeries"`
}
type timeSeries struct {
SourceInfo sourceInfo `json:"sourceInfo"`
Variable variable `json:"variable"`
Values []values `json:"values"`
Name string `json:"name"`
}
type siteCode struct {
Value string `json:"value"`
Network string `json:"network"`
AgencyCode string `json:"agencyCode"`
}
type sourceInfo struct {
SiteCode []siteCode `json:"siteCode"`
}
type variableCode struct {
Value string `json:"value"`
}
type variable struct {
VariableCode []variableCode `json:"variableCode"`
NoDataValue nulltype.NullFloat64 `json:"noDataValue"`
}
type value struct {
Value string `json:"value"`
DateTime core.HTime `json:"dateTime"`
}
type values struct {
Value []value `json:"value"`
}