ricochet-go/rpc/core.proto

65 lines
2.6 KiB
Protocol Buffer

syntax = "proto3";
package ricochet;
import "network.proto";
import "identity.proto";
import "contact.proto";
import "conversation.proto";
service RicochetCore {
// Query RPC server version and status
rpc GetServerStatus (ServerStatusRequest) returns (ServerStatusReply);
// Open a stream to monitor changes to network status. The current
// NetworkStatus will be sent immediately, and the stream will receive a
// new NetworkStatus after any changes until the stream is closed.
rpc MonitorNetwork (MonitorNetworkRequest) returns (stream NetworkStatus);
// Start connecting to the network. Before StartNetwork is called (by any
// client), the backend will not make any connections or appear online.
// This call blocks until the first connection attempt succeeds or fails,
// and returns the current network status, but connection attempts will
// continue unless this call returns an RPC error, or until StopNetwork
// is called.
rpc StartNetwork (StartNetworkRequest) returns (NetworkStatus);
// Stop all network connections and go offline. Blocks until the network
// has been taken offline, and returns the new network status.
rpc StopNetwork (StopNetworkRequest) returns (NetworkStatus);
// XXX Config (tor, etc)
// XXX Protobuf supports maps now. That could also be useful for contact
// update and such...
// XXX Service status
rpc GetIdentity (IdentityRequest) returns (Identity);
// Query contacts and monitor for contact changes. The full contact list
// is sent in POPULATE events, terminated by a POPULATE event with no
// subject. Any new, removed, or modified contacts, including changes in
// the state of contacts, are sent as ADD, UPDATE, or DELETE events until
// the stream is closed.
rpc MonitorContacts (MonitorContactsRequest) returns (stream ContactEvent);
rpc AddContactRequest (ContactRequest) returns (Contact);
rpc UpdateContact (Contact) returns (Contact);
rpc DeleteContact (DeleteContactRequest) returns (DeleteContactReply);
rpc AcceptInboundRequest (ContactRequest) returns (Contact);
rpc RejectInboundRequest (ContactRequest) returns (RejectInboundRequestReply);
// Open a stream to monitor messages in conversations with contacts.
rpc MonitorConversations (MonitorConversationsRequest) returns (stream ConversationEvent);
rpc SendMessage (Message) returns (Message);
rpc MarkConversationRead (MarkConversationReadRequest) returns (Reply);
}
message Reply {
}
message ServerStatusRequest {
int32 rpcVersion = 1;
}
message ServerStatusReply {
int32 rpcVersion = 1;
string serverVersion = 2;
}