Documentation ¶
Index ¶
- type DataLine
- type DataLines
- type DvLIRClient
- func (d *DvLIRClient) AllowResetWithPwd(allow string) (string, error)
- func (d *DvLIRClient) Blink(blink int, pause int) (response int, err error)
- func (d *DvLIRClient) ChangeNetworkSettings(dhcp, ip, sub, gw, dns, ntpName, ntpServer, setDt string) (string, error)
- func (d *DvLIRClient) ChangePassword(pw1, pw2, pw3 string) (string, error)
- func (d *DvLIRClient) ChangeSavingInterval(interval string) (string, error)
- func (d *DvLIRClient) DataLineConversion(input string) DataLine
- func (d *DvLIRClient) DeleteData(code string) (string, error)
- func (d *DvLIRClient) GetDataFile(lines int) (DataLines, error)
- func (d *DvLIRClient) GetGeneralInformation() (GeneralInfo, error)
- func (d *DvLIRClient) GetMomentaryValues() (MomentaryValues, error)
- func (d *DvLIRClient) GetNetworkInformation() (NetworkInfo, error)
- func (d *DvLIRClient) GetSystemInformation() (SystemInfo, error)
- func (d *DvLIRClient) HashTagSplitter(input string) []string
- func (d *DvLIRClient) LineSplitter(input string) []string
- func (d *DvLIRClient) Login() error
- func (d *DvLIRClient) Logout() error
- func (d *DvLIRClient) NTPServerTest(ntpName string) (int, error)
- func (d *DvLIRClient) ResetAll(rCode string) (string, error)
- func (d *DvLIRClient) Restart() (string, error)
- func (d *DvLIRClient) UploadFirmware(filePath string) (string, error)
- type ErrorResponse
- type GeneralInfo
- type HTTPError
- type MomentaryValues
- type NetworkInfo
- type NotValidError
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataLine ¶
type DataLine struct { Index string `json:"index"` Date string `json:"date"` Time string `json:"time"` DvLIRSn string `json:"dvlir_sn"` MeterNumber string `json:"meter_number"` OneEightZero string `json:"one_eight_zero"` OneEightOne string `json:"one_eight_one"` OneEightTwo string `json:"one_eight_two"` TwoEightZero string `json:"two_eight_zero"` TwoEightOne string `json:"two_eight_one"` TwoEightTwo string `json:"two_eight_two"` Power string `json:"power"` Status string `json:"status"` }
DataLine contains the contents of a single line of the daten.csv file
type DvLIRClient ¶
type DvLIRClient struct {
// contains filtered or unexported fields
}
DvLIRClient is an implementation of the client specified for dvlir
func NewDvLIRClient ¶
func NewDvLIRClient(ipAddress string, password string) (*DvLIRClient, error)
NewDvLIRClient generates a new dvlir api-client object which can be used to communicate with the DvLIR-API
func (*DvLIRClient) AllowResetWithPwd ¶
func (d *DvLIRClient) AllowResetWithPwd(allow string) (string, error)
AllowResetWithPwd a performs AllowResetWithPwd operation via the dvlir api-client
func (*DvLIRClient) Blink ¶
func (d *DvLIRClient) Blink(blink int, pause int) (response int, err error)
Blink a performs Blink operation via the dvlir api-client
func (*DvLIRClient) ChangeNetworkSettings ¶
func (d *DvLIRClient) ChangeNetworkSettings(dhcp, ip, sub, gw, dns, ntpName, ntpServer, setDt string) (string, error)
ChangeNetworkSettings a performs ChangeNetworkSettings operation via the dvlir api-client
func (*DvLIRClient) ChangePassword ¶
func (d *DvLIRClient) ChangePassword(pw1, pw2, pw3 string) (string, error)
ChangePassword a performs ChangePassword operation via the dvlir api-client
func (*DvLIRClient) ChangeSavingInterval ¶
func (d *DvLIRClient) ChangeSavingInterval(interval string) (string, error)
ChangeSavingInterval a performs ChangeSavingInterval operation via the dvlir api-client
func (*DvLIRClient) DataLineConversion ¶
func (d *DvLIRClient) DataLineConversion(input string) DataLine
DataLineConversion converts a string into a DataLine struct
func (*DvLIRClient) DeleteData ¶
func (d *DvLIRClient) DeleteData(code string) (string, error)
DeleteData a performs DeleteData operation via the dvlir api-client
func (*DvLIRClient) GetDataFile ¶
func (d *DvLIRClient) GetDataFile(lines int) (DataLines, error)
GetDataFile a performs GetDataFile operation via the dvlir api-client
func (*DvLIRClient) GetGeneralInformation ¶
func (d *DvLIRClient) GetGeneralInformation() (GeneralInfo, error)
GetGeneralInformation a performs GetGeneralInformation operation via the dvlir api-client
func (*DvLIRClient) GetMomentaryValues ¶
func (d *DvLIRClient) GetMomentaryValues() (MomentaryValues, error)
GetMomentaryValues a performs GetMomentaryValue operation via the dvlir api-client
func (*DvLIRClient) GetNetworkInformation ¶
func (d *DvLIRClient) GetNetworkInformation() (NetworkInfo, error)
GetNetworkInformation a performs GetNetworkInformation operation via the dvlir api-client
func (*DvLIRClient) GetSystemInformation ¶
func (d *DvLIRClient) GetSystemInformation() (SystemInfo, error)
GetSystemInformation a performs GetSystemInformation operation via the dvlir api-client
func (*DvLIRClient) HashTagSplitter ¶
func (d *DvLIRClient) HashTagSplitter(input string) []string
HashTagSplitter splits a string at every instance of a #
func (*DvLIRClient) LineSplitter ¶
func (d *DvLIRClient) LineSplitter(input string) []string
LineSplitter splits a string at every instance of \r\n
func (*DvLIRClient) Login ¶
func (d *DvLIRClient) Login() error
Login performs a login via the dvlir api-client
func (*DvLIRClient) Logout ¶
func (d *DvLIRClient) Logout() error
Logout performs a logout via the dvlir api-client
func (*DvLIRClient) NTPServerTest ¶
func (d *DvLIRClient) NTPServerTest(ntpName string) (int, error)
NTPServerTest a performs NTPServerTest operation via the dvlir api-client
func (*DvLIRClient) ResetAll ¶
func (d *DvLIRClient) ResetAll(rCode string) (string, error)
ResetAll a performs ResetAll operation via the dvlir api-client
func (*DvLIRClient) Restart ¶
func (d *DvLIRClient) Restart() (string, error)
Restart a performs Restart operation via the dvlir api-client
func (*DvLIRClient) UploadFirmware ¶
func (d *DvLIRClient) UploadFirmware(filePath string) (string, error)
UploadFirmware a performs UploadFirmware operation via the dvlir api-client
type ErrorResponse ¶
ErrorResponse - Contains error information.
type GeneralInfo ¶
type GeneralInfo struct { ServerIDMeter string `json:"server_id_meter"` MeterNumber string `json:"meter_number"` ManufacturerCode string `json:"manufacturer_code"` IPAddress string `json:"ip_address"` Gateway string `json:"gateway"` DNSServer string `json:"dns_server"` NetworkName string `json:"network_name"` MACAddress string `json:"mac_address"` SavingInterval string `json:"saving_interval"` Date string `json:"date"` Time string `json:"time"` DeviceSn string `json:"device_sn"` FirmwareVersion string `json:"firmware_version"` }
GeneralInfo contains the response of the api in case of a GetGeneralInformation request
type HTTPError ¶
type HTTPError struct { StatusCode int Status string Body *ErrorResponse }
HTTPError - Represents an http error returned by the api.
type MomentaryValues ¶
type MomentaryValues struct { MeterNumber string `json:"meter_number"` OBISNum string `json:"obis_num"` MomentaryPower string `json:"momentary_power"` MeterReadingAP string `json:"meter_reading_ap"` MeterReadingAM string `json:"meter_reading_am"` MeterReadingsAP [9]string `json:"meter_readings_ap"` MeterReadingsAM [9]string `json:"meter_readings_am"` Status string `json:"status"` SavingInterval string `json:"saving_interval"` }
MomentaryValues contains the response of the api in case of a GetMomentaryValues request
type NetworkInfo ¶
type NetworkInfo struct { DHCPServer string `json:"dhcp_server"` IPAddress string `json:"ip_address"` SubnetMask string `json:"subnet_mask"` Gateway string `json:"gateway"` DNSServer string `json:"dns_server"` NTPServer string `json:"ntp_server"` NTPName string `json:"ntp_name"` }
NetworkInfo contains the response of the api in case of a GetNetworkInformation request
type NotValidError ¶
type NotValidError struct{}
NotValidError - Is returned when the client was not initialized properly
func (*NotValidError) Error ¶
func (m *NotValidError) Error() string
type SystemInfo ¶
type SystemInfo struct { SavingInterval string `json:"saving_interval"` ResetCode string `json:"reset_code"` DeleteCode string `json:"delete_code"` ResetWithDefaultPwd string `json:"reset_with_default_pwd"` }
SystemInfo contains the response of the api in case of a GetSystemInformation request