ricochet-go/rpc/core.proto

59 lines
2.4 KiB
Protocol Buffer
Raw Normal View History

2016-08-02 02:58:10 +00:00
syntax = "proto3";
package ricochet;
import "network.proto";
2016-08-17 00:43:39 +00:00
import "identity.proto";
import "contact.proto";
import "conversation.proto";
2016-08-02 02:58:10 +00:00
service RicochetCore {
2016-08-17 00:43:39 +00:00
// Query RPC server version and status
2016-08-02 02:58:10 +00:00
rpc GetServerStatus (ServerStatusRequest) returns (ServerStatusReply);
2016-08-17 00:43:39 +00:00
// 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.
2016-08-02 02:58:10 +00:00
rpc MonitorNetwork (MonitorNetworkRequest) returns (stream NetworkStatus);
2016-08-17 00:43:39 +00:00
// 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.
2016-08-02 02:58:10 +00:00
rpc StartNetwork (StartNetworkRequest) returns (NetworkStatus);
2016-08-17 00:43:39 +00:00
// Stop all network connections and go offline. Blocks until the network
// has been taken offline, and returns the new network status.
2016-08-02 02:58:10 +00:00
rpc StopNetwork (StopNetworkRequest) returns (NetworkStatus);
2016-08-17 00:43:39 +00:00
// XXX Config (tor, etc)
// XXX Service status
rpc GetIdentity (IdentityRequest) returns (Identity);
2016-08-30 02:46:41 +00:00
// 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.
2016-08-17 00:43:39 +00:00
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);
2016-08-02 02:58:10 +00:00
}
message ServerStatusRequest {
int32 rpcVersion = 1;
}
message ServerStatusReply {
int32 rpcVersion = 1;
string serverVersion = 2;
}