Implement a reverse proxy using grpc-gateway
This commit is contained in:
parent
7ababb79f6
commit
8c6230ca20
22 changed files with 3122 additions and 802 deletions
54
proto/accounts/accounts.proto
Normal file
54
proto/accounts/accounts.proto
Normal file
|
@ -0,0 +1,54 @@
|
|||
syntax = "proto3";
|
||||
|
||||
option go_package = "github.com/mdiluz/rove/pkg/accounts";
|
||||
|
||||
package accounts;
|
||||
|
||||
service Accountant {
|
||||
// Register should create a new account in the database
|
||||
// It will return an error if the account already exists
|
||||
rpc Register(RegisterInfo) returns (RegisterResponse) {}
|
||||
|
||||
// AssignValue assigns a key-value pair to an account, or overwrites an existing key
|
||||
rpc AssignValue(DataKeyValue) returns (DataKeyResponse) {}
|
||||
|
||||
// GetValue will get the value for a key for an account
|
||||
rpc GetValue(DataKey) returns (DataResponse) {}
|
||||
}
|
||||
|
||||
// RegisterInfo contains the information needed to register an account
|
||||
message RegisterInfo {
|
||||
// The name for the account, must be unique
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// RegisterResponse is the response information from registering an account
|
||||
message RegisterResponse {}
|
||||
|
||||
// DataKeyValue represents a simple key value pair to assign to an account
|
||||
message DataKeyValue {
|
||||
// The account to assign the new key value pair to
|
||||
string account = 1;
|
||||
|
||||
// The key value pair to assign
|
||||
string key = 2;
|
||||
string value = 3;
|
||||
}
|
||||
|
||||
// DataKeyResponse is a simple response
|
||||
message DataKeyResponse {}
|
||||
|
||||
// DataKey describes a simple key value with an account, for fetching
|
||||
message DataKey {
|
||||
// The account to fetch data for
|
||||
string account = 1;
|
||||
|
||||
// The key to fetch
|
||||
string key = 2;
|
||||
}
|
||||
|
||||
// DataResponse describes a data fetch response
|
||||
message DataResponse {
|
||||
// The value of the key
|
||||
string value = 3;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue