Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active August 6, 2021 11:38
Show Gist options
  • Save percybolmer/56ec5f86078b193a892346d47a31d40c to your computer and use it in GitHub Desktop.
Save percybolmer/56ec5f86078b193a892346d47a31d40c to your computer and use it in GitHub Desktop.
syntax = "proto3";
package main;
option go_package=".;hardwaremonitoring";
// HardwareStats is a struct containing information about the systems Memory usage and CPU
message HardwareStats {
int32 cpu = 1;
int32 memory_free = 2;
int32 memory_used = 3;
}
// EmptyRequest is a way to call gRPC functions without any input data
message EmptyRequest {}
// HardwareMonitor is our service, the service is the API, and rpc statements below will be methods that are available by the API
service HardwareMonitor{
// Monitor will output stats about the hardware on the system host
rpc Monitor(EmptyRequest) returns (stream HardwareStats) {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment