Skip to main content

momento_protos/protosocket/
cache.rs

1// This file is @generated by prost-build.
2/// All messages sent to the server by a client must be CacheCommands.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct CacheCommand {
5    /// This is the unique identifier used for the command. The server will return this id in the response.
6    /// As protosocket-rpc does not necessarily respond in-order this is used to correlate responses with requests.
7    #[prost(uint64, tag = "2")]
8    pub message_id: u64,
9    /// The protosocket-rpc control code.
10    #[prost(uint32, tag = "3")]
11    pub control_code: u32,
12    /// The protosocket-rpc rpc kind.
13    #[prost(oneof = "cache_command::RpcKind", tags = "10")]
14    pub rpc_kind: ::core::option::Option<cache_command::RpcKind>,
15}
16/// Nested message and enum types in `CacheCommand`.
17pub mod cache_command {
18    /// The protosocket-rpc rpc kind.
19    #[derive(Clone, PartialEq, ::prost::Oneof)]
20    pub enum RpcKind {
21        #[prost(message, tag = "10")]
22        Unary(super::Unary),
23    }
24}
25/// These are Unary (single request -> single response) commands.
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct Unary {
28    #[prost(oneof = "unary::Command", tags = "1, 2, 3, 4")]
29    pub command: ::core::option::Option<unary::Command>,
30}
31/// Nested message and enum types in `Unary`.
32pub mod unary {
33    #[derive(Clone, PartialEq, ::prost::Oneof)]
34    pub enum Command {
35        /// Authenticate provides the auth token to be used for all future requests on the connection.
36        /// - It MUST be the first command sent on every cache connection.
37        /// - It MAY be resent later in the connection to provide a different auth token.
38        ///    - If sent mid-connection, clients SHOULD wait to pipeline further commands until the corresponding response is received.
39        ///      If clients do not wait, it is indeterminate whether the prior or new auth token will be used for those requests.
40        #[prost(message, tag = "1")]
41        Auth(super::AuthenticateCommand),
42        /// Retrieves an item from cache.
43        #[prost(message, tag = "2")]
44        Get(super::GetCommand),
45        /// Set an item in cache.
46        #[prost(message, tag = "3")]
47        Set(super::SetCommand),
48        /// Deletes an item from cache.
49        #[prost(message, tag = "4")]
50        Delete(super::DeleteCommand),
51    }
52}
53/// All messages sent by the server to a client will be CacheResponses.
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct CacheResponse {
56    /// This is the message id provided in the corresponding command.
57    #[prost(uint64, tag = "1")]
58    pub message_id: u64,
59    /// The protosocket-rpc control code.
60    #[prost(uint32, tag = "2")]
61    pub control_code: u32,
62    /// The specific response.
63    #[prost(oneof = "cache_response::Kind", tags = "9, 10, 11, 12, 13")]
64    pub kind: ::core::option::Option<cache_response::Kind>,
65}
66/// Nested message and enum types in `CacheResponse`.
67pub mod cache_response {
68    /// The specific response.
69    #[derive(Clone, PartialEq, ::prost::Oneof)]
70    pub enum Kind {
71        #[prost(message, tag = "9")]
72        Error(super::super::common::CommandError),
73        #[prost(message, tag = "10")]
74        Auth(super::AuthenticateResponse),
75        #[prost(message, tag = "11")]
76        Get(super::GetResponse),
77        #[prost(message, tag = "12")]
78        Set(super::SetResponse),
79        #[prost(message, tag = "13")]
80        Delete(super::DeleteResponse),
81    }
82}
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct AuthenticateCommand {
85    #[prost(string, tag = "1")]
86    pub token: ::prost::alloc::string::String,
87}
88#[derive(Clone, Copy, PartialEq, ::prost::Message)]
89pub struct AuthenticateResponse {}
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct GetCommand {
92    #[prost(string, tag = "1")]
93    pub namespace: ::prost::alloc::string::String,
94    #[prost(bytes = "vec", tag = "2")]
95    pub key: ::prost::alloc::vec::Vec<u8>,
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct GetResponse {
99    #[prost(bytes = "vec", tag = "1")]
100    pub value: ::prost::alloc::vec::Vec<u8>,
101}
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct SetCommand {
104    #[prost(string, tag = "1")]
105    pub namespace: ::prost::alloc::string::String,
106    #[prost(bytes = "vec", tag = "2")]
107    pub key: ::prost::alloc::vec::Vec<u8>,
108    #[prost(bytes = "vec", tag = "3")]
109    pub value: ::prost::alloc::vec::Vec<u8>,
110    #[prost(uint64, tag = "4")]
111    pub ttl_milliseconds: u64,
112}
113#[derive(Clone, Copy, PartialEq, ::prost::Message)]
114pub struct SetResponse {}
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct DeleteCommand {
117    #[prost(string, tag = "1")]
118    pub namespace: ::prost::alloc::string::String,
119    #[prost(bytes = "vec", tag = "2")]
120    pub key: ::prost::alloc::vec::Vec<u8>,
121}
122#[derive(Clone, Copy, PartialEq, ::prost::Message)]
123pub struct DeleteResponse {}