mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
databroker: add options for maximum capacity (#2095)
* databroker: add options * implement redis * add trace for enforce options
This commit is contained in:
parent
b3216ae854
commit
636b3d6846
14 changed files with 1085 additions and 419 deletions
|
@ -20,6 +20,13 @@ message Versions {
|
|||
uint64 latest_record_version = 2;
|
||||
}
|
||||
|
||||
// Options are the options for a type stored in the databroker.
|
||||
message Options {
|
||||
// capacity sets a maximum size for the given type. Once the capacity is
|
||||
// reached the oldest records will be removed.
|
||||
optional uint64 capacity = 1;
|
||||
}
|
||||
|
||||
message GetRequest {
|
||||
string type = 1;
|
||||
string id = 2;
|
||||
|
@ -46,6 +53,14 @@ message PutResponse {
|
|||
Record record = 2;
|
||||
}
|
||||
|
||||
message SetOptionsRequest {
|
||||
string type = 1;
|
||||
Options options = 2;
|
||||
}
|
||||
message SetOptionsResponse {
|
||||
Options options = 1;
|
||||
}
|
||||
|
||||
message SyncRequest {
|
||||
uint64 server_version = 1;
|
||||
uint64 record_version = 2;
|
||||
|
@ -71,6 +86,8 @@ service DataBrokerService {
|
|||
rpc Put(PutRequest) returns (PutResponse);
|
||||
// Query queries for records.
|
||||
rpc Query(QueryRequest) returns (QueryResponse);
|
||||
// SetOptions sets the options for a type in the databroker.
|
||||
rpc SetOptions(SetOptionsRequest) returns (SetOptionsResponse);
|
||||
// Sync streams changes to records after the specified version.
|
||||
rpc Sync(SyncRequest) returns (stream SyncResponse);
|
||||
// SyncLatest streams the latest version of every record.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue