Documentation ¶
Index ¶
- type AuthClient
- func (c *AuthClient) Events() ([]EventData, error)
- func (c *AuthClient) EventsWithParam(language string, max int) ([]EventData, error)
- func (c *AuthClient) Login() (string, error)
- func (c *AuthClient) Logout() (bool, error)
- func (c *AuthClient) Me() (map[string]interface{}, error)
- func (c *AuthClient) Modules() ([]ModuleData, error)
- func (c *AuthClient) ProcessData() ([]ProcessData, error)
- func (c *AuthClient) ProcessDataModule(moduleId string) ([]ProcessDataValues, error)
- func (c *AuthClient) ProcessDataModuleValues(moduleId string, processDataIds ...string) ([]ProcessDataValues, error)
- func (c *AuthClient) ProcessDataValues(v []ProcessData) ([]ProcessDataValues, error)
- func (c *AuthClient) SetPassword(password string)
- func (c *AuthClient) SetScheme(scheme string)
- func (c *AuthClient) SetServer(server string)
- func (c *AuthClient) Settings() ([]SettingsData, error)
- func (c *AuthClient) SettingsModule(moduleid string) ([]SettingsValues, error)
- func (c *AuthClient) SettingsModuleSetting(moduleid string, settingid string) ([]SettingsValues, error)
- func (c *AuthClient) SettingsModuleSettings(moduleid string, settingids ...string) ([]SettingsValues, error)
- func (c *AuthClient) Version() (map[string]interface{}, error)
- type AuthCreateSessionType
- type AuthFinishRequestType
- type AuthStartRequestType
- type EventData
- type ModuleData
- type ProcessData
- type ProcessDataValue
- type ProcessDataValues
- type SettingsData
- type SettingsDataValues
- type SettingsValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClient ¶
AuthClient is the library's instance, it contains the configuration settings with SessionId after successful authentication
func NewWithParameter ¶
func NewWithParameter(param AuthClient) *AuthClient
NewWithParameter returns an AuthClient instance. It takes an AuthClient structure as parameter, so it's possible to submit all connection settings in one step.
func (*AuthClient) Events ¶
func (c *AuthClient) Events() ([]EventData, error)
Events returns the latest events as a slice of EventData type
func (*AuthClient) EventsWithParam ¶
func (c *AuthClient) EventsWithParam(language string, max int) ([]EventData, error)
EventsWithParam returns the latest events with localized descriptions. It returns a slice of EventData type. It takes as arguments the language string (currently available de-de, en-gb, es-es, fr-fr, hu-hu, it-it, nl-nl, pl-pl, pt-pt, cs-cz, el-gr and zh-cn) and the maximum number of events (default: 10)
func (*AuthClient) Login ¶
func (c *AuthClient) Login() (string, error)
Login handles the complete authenciation and login process. In case of success it returns the session id.
func (*AuthClient) Logout ¶
func (c *AuthClient) Logout() (bool, error)
Logout deletes the current session
func (*AuthClient) Me ¶
func (c *AuthClient) Me() (map[string]interface{}, error)
Me returns information about the current user
func (*AuthClient) Modules ¶
func (c *AuthClient) Modules() ([]ModuleData, error)
Modules returns a list of modules with their type
func (*AuthClient) ProcessData ¶
func (c *AuthClient) ProcessData() ([]ProcessData, error)
ProcessData returns a slice of ProcessData type, i.e. a list of modules with a list of their process-data identifiers
func (*AuthClient) ProcessDataModule ¶
func (c *AuthClient) ProcessDataModule(moduleId string) ([]ProcessDataValues, error)
ProcessDataModule returns a slice of ProcessDataValues returned by the request to the "processdata/moduleid" endpoint. It takes a moduleid and returns all processdata ids and their values according to the moduleid.
func (*AuthClient) ProcessDataModuleValues ¶
func (c *AuthClient) ProcessDataModuleValues(moduleId string, processDataIds ...string) ([]ProcessDataValues, error)
ProcessDataModuleValues returns a slice of ProcessDataValues returned by a request of a moduleid and one or more of the processdataids which belongs to the moduleid.
func (*AuthClient) ProcessDataValues ¶
func (c *AuthClient) ProcessDataValues(v []ProcessData) ([]ProcessDataValues, error)
ProcessDataValues returns a slice of ProcessDataValues by a request of an arbitrary number of modules with one or more processdataids according to the moduleid. It takes a slice of ProcessData as argument, so it's possible to submit several moduleids with an arbitrary number of their processdataids and get all processdata values with one request to the inverter.
func (*AuthClient) SetPassword ¶
func (c *AuthClient) SetPassword(password string)
SetServer sets the password for user access of the Kostal inverter
func (*AuthClient) SetScheme ¶
func (c *AuthClient) SetScheme(scheme string)
SetServer sets the scheme (http or https) of the Kostal inverter
func (*AuthClient) SetServer ¶
func (c *AuthClient) SetServer(server string)
SetServer sets the IP address or FQDN of the Kostal inverter
func (*AuthClient) Settings ¶
func (c *AuthClient) Settings() ([]SettingsData, error)
Settings returns a list of all modules with their setting identifiers and further parameters of the setting, i.e. max, min, default etc. Warning: The request returns a lot of data, so it takes some time.
func (*AuthClient) SettingsModule ¶
func (c *AuthClient) SettingsModule(moduleid string) ([]SettingsValues, error)
SettingsModule returns a list of settings with settingids and their values of a moduleid
func (*AuthClient) SettingsModuleSetting ¶
func (c *AuthClient) SettingsModuleSetting(moduleid string, settingid string) ([]SettingsValues, error)
SettingsModuleSetting returns a SettingsValues slice with length 1 according to the submitted moduleid and settingid parameter.
func (*AuthClient) SettingsModuleSettings ¶
func (c *AuthClient) SettingsModuleSettings(moduleid string, settingids ...string) ([]SettingsValues, error)
SettingsModuleSettings returns a SettingsValues slice according to the submitted moduleid and settingids parameter. This function takes an arbitrary number of setting ids as arguments.
func (*AuthClient) Version ¶
func (c *AuthClient) Version() (map[string]interface{}, error)
Version returns information about the API; currently name, hostname, sw_version and api_version
type AuthCreateSessionType ¶
type AuthCreateSessionType struct { TransactionId string `json:"transactionId"` Iv string `json:"iv"` Tag string `json:"tag"` Payload string `json:"payload"` }
AuthCreateSessionType defines the JSON structure of the last step in the authentication process
type AuthFinishRequestType ¶
type AuthFinishRequestType struct { TransactionId string `json:"transactionId"` Proof string `json:"proof"` }
AuthFinishRequestType defines the JSON structure of the second step in the authentication process
type AuthStartRequestType ¶
AuthStartRequestType defines the JSON structure of the first step in the authentication process
type EventData ¶
type EventData struct { Description string `json:"description"` Category string `json:"category"` LongDescription string `json:"long_description"` StartTime timefix.InverterTime `json:"start_time"` Group string `json:"group"` EndTime timefix.InverterTime `json:"end_time"` Code int `json:"code"` IsActive bool `json:"is_active"` }
EventData specifies the structure of the response returned by a request to the "events" endpoint
type ModuleData ¶
ModuleData specifies the structure of the response returned by a request to the "modules" endpoint
type ProcessData ¶
type ProcessData struct { ModuleId string `json:"moduleid"` ProcessDataIds []string `json:"processdataids"` }
ProcessData specifies the structure of the response returned by a request to the "processdata" endpoint. Furthermore this type is used in the ProcessDataValues function to define an arbitrary number of moduleids and also an arbitrary number of their processdataids.
type ProcessDataValue ¶
type ProcessDataValue struct { Unit string `json:"unit"` Id string `json:"id"` Value interface{} `json:"value"` }
ProcessDataValue specifies the structure of a single processdata value with its Unit, Processdata-ID and Value
type ProcessDataValues ¶
type ProcessDataValues struct { ModuleId string `json:"moduleid"` ProcessData []ProcessDataValue `json:"processdata"` }
ProcessDataValues specifies the structure of the response returned by a request for processdata with moduleid and a slice of ProcessDataValue which contains the fields Unid, Id and Value
type SettingsData ¶
type SettingsData struct { ModuleId string `json:"moduleid"` Settings []SettingsDataValues `json:"settings"` }
SettingsData specifies the structure of the response returned by a request to the "settings" endpoint. It embeds a slice of SettingsDataValues type.
type SettingsDataValues ¶
type SettingsDataValues struct { Id string `json:"id"` Max string `json:"max"` Min string `json:"min"` Unit string `json:"unit"` Type interface{} `json:"type"` Access interface{} `json:"access"` Default string `json:"default"` }
SettingsDataValues specifies the structure of a setting element returned by a request to the "settings" endpoint
type SettingsValues ¶
SettingsValues specifies the structure of the response returned by a request to the "settings/moduleid/..." endpoint. The structure defines a settingid and its value.