Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a container for holding authentication state for API interfacing
func (API) GetProjects ¶
GetProjects returns all projects that the authenticated account invested in
type HTTPClient ¶
HTTPClient is the interface that should be implemented by API HTTP clients while this usually is just the default HTTP client, but it allows to override the HTTP client for additional control over API calls or testing purposes
var HTTPAPIClient HTTPClient
HTTPAPIClient is the HTTP client used for interfacing with the API
type Measurement ¶
type Measurement struct { Production float64 `json:"production_kWh"` Expected float64 `json:"expected_production_kWh"` Cumulative float64 `json:"cumulative_production_kWh"` ExpectedCumulative float64 `json:"expected_cumulative_production_kWh"` Timestamp string `json:"timestamp"` }
Measurement holds measurements for a specific moment in time
type Metrics ¶
type Metrics struct { Parts int `json:"solar_parts"` Interest float64 `json:"solar_interest"` Value int `json:"net_value"` Today TimeMetrics `json:"production_today"` LastMonth TimeMetrics `json:"production_last_month"` LastYear TimeMetrics `json:"production_last_year"` All TimeMetrics `json:"production_all"` }
Metrics is a container for all sorts of project metrics
type Project ¶
type Project struct { Name string `json:"name"` ID int `json:"id"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` IsHidden bool `json:"is_hidden"` Metrics Metrics `json:"metrics"` }
Project is a single zonnepanelendelen project
type TimeMetrics ¶
type TimeMetrics struct { TotalPower float64 `json:"total_power_kWh"` TotalExpected float64 `json:"total_power_expected_kWh"` TotalProfit float64 `json:"total_profit"` ROI float64 `json:"return_on_investment"` Measurements []Measurement `json:"data"` }
TimeMetrics combine certain metrics over a specific period in time