usgs

package
v0.0.0-...-1582af6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GaugeHeight      = "00065"
	Discharge        = "00060"
	WaterTemperature = "00010"
	Location         = "91110"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct{ Host string }

func NewMock

func NewMock() *Mock

func (*Mock) Start

func (m *Mock) Start()

type TimeSeries

type TimeSeries struct {
	SourceInfo struct {
		SiteName string `json:"siteName"`
		SiteCode []struct {
			Value      string `json:"value"`
			Network    string `json:"network"`
			AgencyCode string `json:"agencyCode"`
		} `json:"siteCode"`
		TimeZoneInfo struct {
			DefaultTimeZone struct {
				ZoneOffset       string `json:"zoneOffset"`
				ZoneAbbreviation string `json:"zoneAbbreviation"`
			} `json:"defaultTimeZone"`
			DaylightSavingsTimeZone struct {
				ZoneOffset       string `json:"zoneOffset"`
				ZoneAbbreviation string `json:"zoneAbbreviation"`
			} `json:"daylightSavingsTimeZone"`
			SiteUsesDaylightSavingsTime bool `json:"siteUsesDaylightSavingsTime"`
		} `json:"timeZoneInfo"`
		GeoLocation struct {
			GeogLocation struct {
				Srs       string  `json:"srs"`
				Latitude  float64 `json:"latitude"`
				Longitude float64 `json:"longitude"`
			} `json:"geogLocation"`
			LocalSiteXY []interface{} `json:"localSiteXY"`
		} `json:"geoLocation"`
		Note         []interface{} `json:"note"`
		SiteType     []interface{} `json:"siteType"`
		SiteProperty []struct {
			Value string `json:"value"`
			Name  string `json:"name"`
		} `json:"siteProperty"`
	} `json:"sourceInfo"`
	Variable struct {
		VariableCode        []VariableCode `json:"variableCode"`
		VariableName        string         `json:"variableName"`
		VariableDescription string         `json:"variableDescription"`
		ValueType           string         `json:"valueType"`
		Unit                struct {
			UnitCode string `json:"unitCode"`
		} `json:"unit"`
		Options struct {
			Option []struct {
				Name       string `json:"name"`
				OptionCode string `json:"optionCode"`
			} `json:"option"`
		} `json:"options"`
		Note             []interface{} `json:"note"`
		NoDataValue      float64       `json:"noDataValue"`
		VariableProperty []interface{} `json:"variableProperty"`
		Oid              string        `json:"oid"`
	} `json:"variable"`
	Values []Value `json:"values"`
	Name   string  `json:"name"`
}

type TimeSeriesResponse

type TimeSeriesResponse struct {
	Name         string `json:"name"`
	DeclaredType string `json:"declaredType"`
	Scope        string `json:"scope"`
	Value        struct {
		QueryInfo struct {
			QueryURL string `json:"queryURL"`
			Criteria struct {
				LocationParam string        `json:"locationParam"`
				VariableParam string        `json:"variableParam"`
				Parameter     []interface{} `json:"parameter"`
			} `json:"criteria"`
			Note []struct {
				Value string `json:"value"`
				Title string `json:"title"`
			} `json:"note"`
		} `json:"queryInfo"`
		TimeSeries []TimeSeries `json:"timeSeries"`
	} `json:"value"`
	Nil             bool `json:"nil"`
	GlobalScope     bool `json:"globalScope"`
	TypeSubstituted bool `json:"typeSubstituted"`
}

Generated by: https://mholt.github.io/json-to-go/

func ReadGauge

func ReadGauge(siteCode string, parameters []string) (TimeSeriesResponse, error)

func (*TimeSeriesResponse) GetCoordinates

func (t *TimeSeriesResponse) GetCoordinates() (float64, float64, error)

func (*TimeSeriesResponse) GetMostRecentDischarge

func (t *TimeSeriesResponse) GetMostRecentDischarge() (float64, error)

func (*TimeSeriesResponse) GetMostRecentGaugeHeight

func (t *TimeSeriesResponse) GetMostRecentGaugeHeight() (float64, error)

func (*TimeSeriesResponse) GetMostRecentWaterTemperature

func (t *TimeSeriesResponse) GetMostRecentWaterTemperature() (float64, error)

type TimeSeriesValue

type TimeSeriesValue struct {
	Value      string   `json:"value"`
	Qualifiers []string `json:"qualifiers"`
	DateTime   string   `json:"dateTime"`
}

type Value

type Value struct {
	Value     []TimeSeriesValue `json:"value"`
	Qualifier []struct {
		QualifierCode        string `json:"qualifierCode"`
		QualifierDescription string `json:"qualifierDescription"`
		QualifierID          int    `json:"qualifierID"`
		Network              string `json:"network"`
		Vocabulary           string `json:"vocabulary"`
	} `json:"qualifier"`
	QualityControlLevel []interface{} `json:"qualityControlLevel"`
	Method              []struct {
		MethodDescription string `json:"methodDescription"`
		MethodID          int    `json:"methodID"`
	} `json:"method"`
	Source     []interface{} `json:"source"`
	Offset     []interface{} `json:"offset"`
	Sample     []interface{} `json:"sample"`
	CensorCode []interface{} `json:"censorCode"`
}

type VariableCode

type VariableCode struct {
	Value      string `json:"value"`
	Network    string `json:"network"`
	Vocabulary string `json:"vocabulary"`
	VariableID int    `json:"variableID"`
	Default    bool   `json:"default"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL