Documentation ¶
Index ¶
- Variables
- func AddAsset()
- func AddPledge()
- func CheckGetAuth(w http.ResponseWriter, r *http.Request) (database.User, error)
- func CheckPostAdmin(w http.ResponseWriter, r *http.Request) (database.User, error)
- func CheckPostAuth(w http.ResponseWriter, r *http.Request) (database.User, error)
- func CommitPledge()
- func RetrieveAllFromIpfs()
- func RetrieveFromIpfs()
- func StartServer(portx int, insecure bool)
- func UpdateAsset()
- func UpdateMRV()
- func UpdatePledge()
- func VerifyUser()
- func ViewCompanyEarth()
- func WorldBankMonthlyTempByCountry(iso3 string, startdate string, enddate string) (interface{}, error)
- type CarbonDataFinal
- type CarbonDataPrelim
- type CountriesEmissionsFinal
- type CountriesEmissionsPrelim
- type CountryIdResponse
- type EarthStatusReturn
- type GetAccessTokenData
- type GetAssetStruct
- type GetEnergyAttributionData
- type GetEnergyStruct
- type GetSwytchUserStruct
- type NationState
- type NazcaResponse
- type OceanDataFinal
- type OceanDataPrelim
- type ParisAgreementReturn
- type ParisAgreementReturnFinal
- type PostLoginResponse
- type ReportIpcc
- type Subnational
- type USStateCountiesReturn
- type USStatesReturn
Constants ¶
This section is empty.
Variables ¶
var NazcaURL = "https://nazcaapiprod.howoco.com/handlers/countrystakeholders.ashx?countryid="
Functions ¶
func AddAsset ¶
func AddAsset()
URL parameters: N/A Response body (all strings): - name - companyID (not required) - location - type
func CheckGetAuth ¶
func CheckPostAdmin ¶
func CheckPostAuth ¶
func CommitPledge ¶
func CommitPledge()
func RetrieveAllFromIpfs ¶
func RetrieveAllFromIpfs()
Retrieve all data related to a given actor that has been committed to IPFS. This includes both emissions, mitigation, and adaptation data.
func RetrieveFromIpfs ¶
func RetrieveFromIpfs()
Request & retrieve data for a specific actor that has been committed to IPFS. HTTP request to our API will provide the actor type and actor id; then RetrieveFromIpfs() will look at the smart contract to retrieve all IPFS hashes related to that type/ID pair. It then queries IPFS for that data using the hashes and then makes that data available on the openclimate API.
URL parameters:
- "report_type": the type of climate action data that was reported. can be either emissions, mitigation, or adaptation.
- "actor_type": either city, country, region, state, company, etc.
- "actor_id": the ID assigned to the actor in the database.
func StartServer ¶
func UpdateAsset ¶
func UpdateAsset()
URL parameters: - Asset ID
Response body data (all strings): - companyID (not necessary) - name - location - type
func UpdatePledge ¶
func UpdatePledge()
func VerifyUser ¶
func VerifyUser()
Function allows admins of a particular entity to "verify" other users who claim to be part of the same entity.
URL parameters: - "candidate_id": the ID of the user who is being considered for verification
func ViewCompanyEarth ¶
func ViewCompanyEarth()
Types ¶
type CarbonDataFinal ¶
type CarbonDataFinal struct { FossilFuelAndIndustry float64 `json:"Fossil-Fuel-And-Industry"` LandUseChangeEmissions float64 `json:"Land-Use-Change-Emissions"` AtmosphericGrowth float64 `json:"Atmospheric-Growth"` OceanSink float64 `json:"Ocean-Sink"` LandSink float64 `json:"Land-Sink"` BudgetImbalance float64 `json:"Budget-Imbalance"` }
type CarbonDataPrelim ¶
type CarbonDataPrelim struct { Year int `json:"Year"` FossilFuelAndIndustry float64 `json:"Fossil-Fuel-And-Industry"` LandUseChangeEmissions float64 `json:"Land-Use-Change-Emissions"` AtmosphericGrowth float64 `json:"Atmospheric-Growth"` OceanSink float64 `json:"Ocean-Sink"` LandSink float64 `json:"Land-Sink"` BudgetImbalance float64 `json:"Budget-Imbalance"` }
type CountriesEmissionsFinal ¶
type CountryIdResponse ¶
type EarthStatusReturn ¶
type GetAccessTokenData ¶
type GetAccessTokenData struct {
Data []getAccessTokenDataHelper `json:"data"`
}
type GetAssetStruct ¶
type GetAssetStruct struct {
Data []gA2 `json:"data"`
}
type GetEnergyAttributionData ¶
type GetEnergyAttributionData struct {
Data []getEnergyAttributionHelper `json:"data"`
}
type GetEnergyStruct ¶
type GetEnergyStruct struct {
Data []getEnergyHelper `json:"data"`
}
type GetSwytchUserStruct ¶
type GetSwytchUserStruct struct {
Data []getSwytchUserStructHelper `json:"data"`
}
type NationState ¶
type NationState struct { Name string Pledges []database.Pledge Subnational []Subnational }
type NazcaResponse ¶
type NazcaResponse struct { EntityID string `json:"entityID"` EntityName string `json:"entityName"` CountryName string `json:"countryName"` EntityTypeName string `json:"entityTypeName"` Actions []struct { ActionType string `json:"actionType"` Name string `json:"name"` Description string `json:"description"` Adhoc string `json:"adhoc"` } }
type OceanDataFinal ¶
type OceanDataFinal struct { OceanSink float64 `json:"Ocean-Sink"` CCSMBEC float64 `json:"CCSM-BEC"` MITgcmREcoM2 float64 `json:"MITgcm-REcoM2"` MPIOMHAMOCC float64 `json:"MPIOM-HAMOCC"` NEMO36PISCESv2gas float64 `json:"NEMO3.6-PISCESv2-gas (CNRM)"` NEMOPISCESIPSL float64 `json:"NEMO-PISCES (IPSL)"` NEMOPlankTOM5 float64 `json:"NEMO-PlankTOM5"` NorESMOC float64 `json:"NorESM-OC"` Landschutzer float64 `json:"Landschützer"` Rodenbeck float64 `json:"Rödenbeck"` }
type OceanDataPrelim ¶
type OceanDataPrelim struct { Year int `json:"year"` OceanSink float64 `json:"Ocean-Sink"` CCSMBEC float64 `json:"CCSM-BEC"` MITgcmREcoM2 float64 `json:"MITgcm-REcoM2"` MPIOMHAMOCC float64 `json:"MPIOM-HAMOCC"` NEMO36PISCESv2gas float64 `json:"NEMO3.6-PISCESv2-gas (CNRM)"` NEMOPISCESIPSL float64 `json:"NEMO-PISCES (IPSL)"` NEMOPlankTOM5 float64 `json:"NEMO-PlankTOM5"` NorESMOC float64 `json:"NorESM-OC"` Landschutzer float64 `json:"Landschützer"` Rodenbeck float64 `json:"Rödenbeck"` }
type ParisAgreementReturn ¶
type ParisAgreementReturn struct { Code string `json:"Code"` Name string `json:"Name"` Signature string `json:"Signature"` Ratification string `json:"Ratification"` Kind string `json:"Kind"` DateOfEffect string `json:"Date-Of-Effect"` Emissions float64 `json:"Emissions"` Percentage float64 `json:"Percentage"` Year float64 `json:"Year"` }
type ParisAgreementReturnFinal ¶
type ParisAgreementReturnFinal struct { Name string `json:"Name"` Signature string `json:"Signature"` Ratification string `json:"Ratification"` Kind string `json:"Kind"` DateOfEffect string `json:"Date-Of-Effect"` Emissions float64 `json:"Emissions"` Percentage float64 `json:"Percentage"` Year float64 `json:"Year"` }
type PostLoginResponse ¶
type PostLoginResponse struct {
Token string
}
type ReportIpcc ¶
type ReportIpcc struct { }
type Subnational ¶
type USStateCountiesReturn ¶
type USStatesReturn ¶
type USStatesReturn struct {
States []string
}