mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-24 00:15:29 +00:00
Add the carbon api (#351)
This commit is contained in:
32
carbon/proto/carbon.proto
Normal file
32
carbon/proto/carbon.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package carbon;
|
||||
|
||||
option go_package = "./proto;carbon";
|
||||
|
||||
service Carbon {
|
||||
rpc Offset(OffsetRequest) returns (OffsetResponse) {}
|
||||
}
|
||||
|
||||
message Project {
|
||||
// name of the project
|
||||
string name = 1;
|
||||
// percentage that went to this
|
||||
double percentage = 2;
|
||||
// amount in tonnes
|
||||
double tonnes = 3;
|
||||
}
|
||||
|
||||
// Purchase 1kg (0.001 tonnes) of carbon offsets in a single request
|
||||
message OffsetRequest {}
|
||||
|
||||
message OffsetResponse {
|
||||
// number of units purchased
|
||||
int32 units = 1;
|
||||
// the metric used e.g KG or Tonnes
|
||||
string metric = 2;
|
||||
// number of tonnes
|
||||
double tonnes = 3;
|
||||
// projects it was allocated to
|
||||
repeated Project projects = 4;
|
||||
}
|
||||
Reference in New Issue
Block a user