mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
92 lines
1.6 KiB
Protocol Buffer
92 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package notes;
|
|
|
|
option go_package = "./proto;notes";
|
|
|
|
service Notes {
|
|
rpc List(ListRequest) returns (ListResponse);
|
|
rpc Create(CreateRequest) returns (CreateResponse);
|
|
rpc Read(ReadRequest) returns (ReadResponse);
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
rpc Update(UpdateRequest) returns (UpdateResponse);
|
|
rpc Events(EventsRequest) returns (stream EventsResponse);
|
|
}
|
|
|
|
message Note {
|
|
// unique id for the note, generated if not specified
|
|
string id = 1;
|
|
// time at which the note was created
|
|
string created = 2;
|
|
// time at which the note was updated
|
|
string updated = 3;
|
|
// title of the note
|
|
string title = 4;
|
|
// text within the note
|
|
string text = 5;
|
|
}
|
|
|
|
// Create a new note
|
|
message CreateRequest {
|
|
// note title
|
|
string title = 1;
|
|
// note text
|
|
string text = 2;
|
|
}
|
|
|
|
message CreateResponse {
|
|
// The created note
|
|
Note note = 1;
|
|
}
|
|
|
|
// Read a note
|
|
message ReadRequest {
|
|
// the note id
|
|
string id = 1;
|
|
}
|
|
|
|
message ReadResponse {
|
|
// The note
|
|
Note note = 1;
|
|
}
|
|
|
|
// Update a note
|
|
message UpdateRequest {
|
|
Note note = 1;
|
|
}
|
|
|
|
message UpdateResponse {
|
|
Note note = 1;
|
|
}
|
|
|
|
// Delete a note
|
|
message DeleteRequest {
|
|
// specify the id of the note
|
|
string id = 1;
|
|
}
|
|
|
|
message DeleteResponse {
|
|
Note note = 1;
|
|
}
|
|
|
|
// List all the notes
|
|
message ListRequest {}
|
|
|
|
message ListResponse {
|
|
// the list of notes
|
|
repeated Note notes = 1;
|
|
}
|
|
|
|
// Subscribe to notes events
|
|
message EventsRequest {
|
|
// optionally specify a note id
|
|
string id = 1;
|
|
}
|
|
|
|
message EventsResponse {
|
|
// the event which occured; create, delete, update
|
|
string event = 1;
|
|
// the note which the operation occured on
|
|
Note note = 2;
|
|
}
|