package
0.0.0-20241101195016-be2ca6b56628
Repository: https://github.com/glowlabs-org/gca-backend.git
Documentation: pkg.go.dev

# Functions

Returns the current time of the protocol, as measured in 5 minute increments from genesis.
DeserializeEquipmentAuthorization deserializes a byte slice into an EquipmentAuthorization.
DeserializeReport takes a byte slice and attempts to convert it back into an EquipmentReport structure.
GenerateKeyPair generates a new ECDSA private and public key pair.
GenerateSecureRandomInt generates a secure random integer between min and max (inclusive).
GenerateTestDir generates a temporary directory path for placing test files.
NewEventLogger creates an in-memory event logger with size limitations to protect the client from run-time failures.
Create a new RateLimiter.
PubKeyToAddr will convert a PublicKey to its corresponding Ethereum Address.
SendUDPReport simulates sending a report to the server via UDP.
Sign generates an Ethereum signature for given data using a private key.
TimeslotToUnix converts a timeslot to the unix timestamp that it began.
UnixToTimeslot converts a unix time to the current timeslot.
Verify checks the Ethereum signature for given data and a public key.

# Constants

GenesisTime determines what counts as 'week 0' for the Glow protocol.

# Structs

EquipmentAuthorization struct defines an authorization for a piece of equipment.
EquipmentReport defines the structure for a report received from a piece of equipment.
EventLogger keeps track logged events and manages their size in memory, allowing for duplicate entries.
LogEntry contains a logged string, and a list of time ordered timestamps.
Rate limiter, to allow a maximum number of requests for a time duration.
SafeMu is an object that wraps sync.Mutex to help locate deadlocks.

# Type aliases

PrivateKey represents a 32-byte private key.
PublicKey represents a 32-byte public key.
Signature represents a 64-byte signature.