1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
    #[prost(uint64, tag="1")]
    pub id: u64,
    #[prost(oneof="request::Command", tags="2, 10, 11, 12, 30")]
    pub command: ::core::option::Option<request::Command>,
}
/// Nested message and enum types in `Request`.
pub mod request {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Hello {
        #[prost(string, tag="1")]
        pub version: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct RunProcess {
        #[prost(string, tag="1")]
        pub bin: ::prost::alloc::string::String,
        #[prost(string, repeated, tag="2")]
        pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        #[prost(string, tag="3")]
        pub work_dir: ::prost::alloc::string::String,
        #[prost(message, optional, tag="4")]
        pub stdout: ::core::option::Option<super::Output>,
        #[prost(message, optional, tag="5")]
        pub stderr: ::core::option::Option<super::Output>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct KillProcess {
        #[prost(uint64, tag="1")]
        pub pid: u64,
        #[prost(int32, tag="2")]
        pub signal: i32,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct CreateNetwork {
        #[prost(message, repeated, tag="1")]
        pub networks: ::prost::alloc::vec::Vec<super::Network>,
        #[prost(map="string, string", tag="2")]
        pub hosts: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
        #[prost(enumeration="super::NetworkInterface", tag="3")]
        pub interface: i32,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Shutdown {
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Command {
        #[prost(message, tag="2")]
        Hello(Hello),
        #[prost(message, tag="10")]
        Run(RunProcess),
        #[prost(message, tag="11")]
        Kill(KillProcess),
        #[prost(message, tag="12")]
        Shutdown(Shutdown),
        #[prost(message, tag="30")]
        Network(CreateNetwork),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
    /// if false then id represents correlation id for response message.
    #[prost(bool, tag="1")]
    pub event: bool,
    #[prost(uint64, tag="2")]
    pub id: u64,
    #[prost(oneof="response::Command", tags="3, 4, 10, 11, 12, 20, 21, 30")]
    pub command: ::core::option::Option<response::Command>,
}
/// Nested message and enum types in `Response`.
pub mod response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Hello {
        #[prost(string, tag="1")]
        pub version: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Error {
        #[prost(enumeration="ErrorCode", tag="1")]
        pub code: i32,
        #[prost(string, tag="2")]
        pub message: ::prost::alloc::string::String,
        #[prost(map="string, string", tag="3")]
        pub context: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct RunProcess {
        #[prost(uint64, tag="1")]
        pub pid: u64,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct KillProcess {
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ProcessStatus {
        #[prost(uint64, tag="1")]
        pub pid: u64,
        #[prost(bool, tag="2")]
        pub running: bool,
        #[prost(int32, tag="3")]
        pub return_code: i32,
        #[prost(bytes="vec", tag="4")]
        pub stdout: ::prost::alloc::vec::Vec<u8>,
        #[prost(bytes="vec", tag="5")]
        pub stderr: ::prost::alloc::vec::Vec<u8>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct RuntimeStatus {
        #[prost(oneof="runtime_status::Kind", tags="1, 2")]
        pub kind: ::core::option::Option<runtime_status::Kind>,
    }
    /// Nested message and enum types in `RuntimeStatus`.
    pub mod runtime_status {
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct State {
            #[prost(string, tag="1")]
            pub name: ::prost::alloc::string::String,
            #[prost(bytes="vec", tag="2")]
            pub value: ::prost::alloc::vec::Vec<u8>,
        }
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Counter {
            #[prost(string, tag="1")]
            pub name: ::prost::alloc::string::String,
            #[prost(double, tag="2")]
            pub value: f64,
        }
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Kind {
            #[prost(message, tag="1")]
            State(State),
            #[prost(message, tag="2")]
            Counter(Counter),
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct CreateNetwork {
        #[prost(oneof="create_network::Endpoint", tags="1, 2, 3, 4, 5")]
        pub endpoint: ::core::option::Option<create_network::Endpoint>,
    }
    /// Nested message and enum types in `CreateNetwork`.
    pub mod create_network {
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Endpoint {
            #[prost(string, tag="1")]
            UnixStream(::prost::alloc::string::String),
            #[prost(string, tag="2")]
            UnixDatagram(::prost::alloc::string::String),
            #[prost(string, tag="3")]
            UdpDatagram(::prost::alloc::string::String),
            #[prost(string, tag="4")]
            TcpListener(::prost::alloc::string::String),
            #[prost(string, tag="5")]
            TcpStream(::prost::alloc::string::String),
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Shutdown {
    }
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum ErrorCode {
        Internal = 0,
        NotFound = 1,
        BadRequest = 2,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Command {
        #[prost(message, tag="3")]
        Error(Error),
        #[prost(message, tag="4")]
        Hello(Hello),
        #[prost(message, tag="10")]
        Run(RunProcess),
        #[prost(message, tag="11")]
        Kill(KillProcess),
        #[prost(message, tag="12")]
        Shutdown(Shutdown),
        /// Events
        #[prost(message, tag="20")]
        Status(ProcessStatus),
        #[prost(message, tag="21")]
        RtStatus(RuntimeStatus),
        /// Network ctl
        #[prost(message, tag="30")]
        Network(CreateNetwork),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Network {
    #[prost(string, tag="1")]
    pub addr: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub gateway: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub mask: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub if_addr: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Output {
    /// No-type = /dev/null
    /// at_end(buffer size) = last n bytes are returned.
    #[prost(oneof="output::Type", tags="2")]
    pub r#type: ::core::option::Option<output::Type>,
}
/// Nested message and enum types in `Output`.
pub mod output {
    /// No-type = /dev/null
    /// at_end(buffer size) = last n bytes are returned.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Type {
        #[prost(uint32, tag="2")]
        AtEnd(u32),
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NetworkInterface {
    Vpn = 0,
    Inet = 1,
}