cloverly

package
v0.0.0-...-b2d281f Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloverly

type Cloverly struct {
	// contains filtered or unexported fields
}

func New

func New() Cloverly

func (*Cloverly) CreateCarbonEstimate

func (c *Cloverly) CreateCarbonEstimate(carbon int) (*models.Estimate, error)

Estimate creates a Cloverly estimate for the given volume of carbon

func (*Cloverly) Purchase

func (c *Cloverly) Purchase(estimate models.EstimateIn) (*models.Purchase, error)

func (*Cloverly) RetrieveEstimate

func (c *Cloverly) RetrieveEstimate(slug string) (*models.Estimate, error)

type CloverlyOpts

type CloverlyOpts struct {
}

type Response

type Response struct {
	Error                     string  `json:"error"`
	Slug                      string  `json:"slug"`
	Environment               string  `json:"environment"`
	State                     string  `json:"state"`
	MicroRecCount             int     `json:"micro_rec_count"`
	MicroUnits                int     `json:"micro_units"`
	TotalCostInUSDCents       int     `json:"total_cost_in_usd_cents"`
	EstimatedAt               string  `json:"estimated_at"`
	EquivalentCarbonInKG      float64 `json:"equivalent_carbon_in_kg"`
	ElectricityInKWH          float64 `json:"electricity_in_kwh"`
	RecCostInUSDCents         int     `json:"rec_cost_in_usd_cents"`
	TransactionCostInUSDCents int     `json:"transaction_cost_in_usd_cents"`
	PrettyURL                 string  `json:"pretty_url"`
	Offset                    struct {
		Slug          string
		Name          string
		City          string
		Province      string
		Country       string
		OffsetType    string `json:"offset_type"`
		TotalCapacity string `json:"total_capacity"`
		LatLong       struct {
			X float64
			Y float64
		} `json:"latlng"`
		TechnicalDetails    string  `json:"technical_details"`
		AvailableCarbonInKG float64 `json:"available_carbon_in_kg"`
		PrettyURL           string  `json:"pretty_url"`
	} `json:"offset"`
	RenewableEnergyCertificate struct {
		Slug          string
		Name          string
		City          string
		Province      string
		Country       string
		RenewableType string `json:"renewable_type"`
		TotalCapacity string `json:"total_capacity"`
		LatLong       struct {
			X float64
			Y float64
		} `json:"latlng"`
		TechnicalDetails string `json:"technical_details"`
		Deprecated       string
	} `json:"renewable_energy_certificate"`
}

Response matches the schema of an estimate or purchase response from Cloverly

Jump to

Keyboard shortcuts

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