Documentation ¶
Index ¶
Constants ¶
View Source
const ( // The file that contains the authorization for the client, signed by // the GCA. AuthorizationFile = "authorization.dat" // The file that contains the keypair for the client, authorized by the GCA. ClientKeyFile = "clientKeys.dat" // The file that contains the public key of the GCA. GCAPubKeyFile = "gcaPubKey.dat" // GCAServerMapFile contains the list of servers that the GCA has online. It // will also contain banned servers. GCAServerMapFile = "gcaServers.dat" // HistoryFile contains all of the historic power readings for this solar // installation. HistoryFile = "history.dat" // ShortIDFile contains the ShortID of the device, which is useful for // compressing communications with the GCA servers. ShortIDFile = "shortID.dat" // CTSettingsFile contains the current transformer multiplier. CTSettingsFile = "ct-settings.txt" )
View Source
const ( // EnergyFile is the file used by the monitoring equipment to write the total // amount of energy that was measured in each timeslot. EnergyFile = "/opt/halki/energy_data.csv" // CTMultiplier is the multiplier that we use on the current // transformer to correctly normalize the readings from the current // transformer. The reported energy value is first multiplied, then divided by // these values. EnergyMultiplierDefault = -2000 EnergyDividerDefault = 1000 // UDPSleepSyncTime sets the amount of time that the system sleeps // between each UDP packet that gets sent. We sleep between packets // because the cell network can only handle at points less than 1 kbps // of traffic, and sending a ton of packets all at once during a sync // operation is all but guaranteed to get them dropped. UDPSleepSyncTime = time.Second // Event log constants. These values limit the in-memory footprint // of the event logging system. EventLogExpiry = 30 * 24 * time.Hour EventLogLimitBytes = 10e6 EventLogLineLimitBytes = 500 )
Variables ¶
This section is empty.
Functions ¶
func SerializeGCAServerMap ¶
This is a function for creating the server map and saving it to disk.
Types ¶
type Client ¶
type Client struct { // Event log. EventLog *glow.EventLogger // contains filtered or unexported fields }
The stateful object for the client.
func (*Client) DumpEventLogs ¶
Helper to dump client status to a string. Returns general information, followed by the event log.
type EnergyRecord ¶
Represents one row of data from the energy file.
Click to show internal directories.
Click to hide internal directories.