Documentation
¶
Overview ¶
Package configuration configures credentials for accessing the SunSynk API.
Index ¶
Constants ¶
const DefaultEndpoint = "https://api.sunsynk.net"
DefaultEndpoint is SunSynk's region 1 endpoint.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigurationFile ¶ added in v0.15.0
DefaultConfigurationFile gets the path to the default location of the synk config file ($HOME/.synk/config on Linux).
func WriteConfigurationToFile ¶
func WriteConfigurationToFile(fileName string, configuration *Configuration) error
WriteConfigurationToFile writes a marshalled configuration object to a YAML file
Types ¶
type Configuration ¶
type Configuration struct {
Endpoint string `yaml:"endpoint"`
User string `yaml:"user"`
Password string `yaml:"password"`
DefaultInverterSN string `yaml:"default_inverter_sn,omitempty"`
}
Configuration stores the credentials to access the SunSynk API
func New ¶
func New(user string, password string) (*Configuration, error)
New constructs a configuration object with a specified username/password combination using the default region 1 (London) endpoint
func NewWithEndpoint ¶
func NewWithEndpoint(user string, password string, endpoint string) (*Configuration, error)
NewWithEndpoint constructs a configuration object with username/password credentials and an overridden API endpoint
func ReadConfigurationFromFile ¶
func ReadConfigurationFromFile(fileName string) (*Configuration, error)
ReadConfigurationFromFile unnmarshals a configuration object from a YAML file