graphql

package
v0.0.0-...-aa513c4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURI = "https://api.octopus.energy"

BaseURI is Octopus Energy's core API root.

View Source
const URI = BaseURI + "/v1/graphql/"

URI is the GraphQL query endpoint for Octopus Energy.

Variables

This section is empty.

Functions

This section is empty.

Types

type OctopusGraphQLClient

type OctopusGraphQLClient struct {
	*graphql.Client
	// contains filtered or unexported fields
}

OctopusGraphQLClient provides an interface for communicating with Octopus Energy's Kraken platform.

func NewClient

func NewClient(log *util.Logger, apikey string) (*OctopusGraphQLClient, error)

NewClient returns a new, unauthenticated instance of OctopusGraphQLClient.

func (*OctopusGraphQLClient) AccountNumber

func (c *OctopusGraphQLClient) AccountNumber() (string, error)

AccountNumber queries the Account Number assigned to the associated API key. Caching is provided.

func (*OctopusGraphQLClient) TariffCode

func (c *OctopusGraphQLClient) TariffCode() (string, error)

TariffCode queries the Tariff Code of the first Electricity Agreement active on the account.

Jump to

Keyboard shortcuts

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