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
/*
   Copyright The containerd Authors.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

#![cfg_attr(feature = "docs", doc = include_str!("../README.md"))]
#![allow(warnings)]

pub use protobuf;
pub use ttrpc;

pub mod cgroups;
pub mod events;
#[cfg(feature = "sandbox")]
mod sandbox;
pub mod shim;
pub mod types;
pub mod windows;

/// Includes event names shims can publish to containerd.
pub mod topics;

pub mod shim_sync {
    /// TTRPC client reexport for easier access.
    pub use ttrpc::Client;

    /// Shim events service.
    pub use crate::shim::events_ttrpc::{create_events, Events, EventsClient};
    /// Shim task service.
    pub use crate::shim::shim_ttrpc::{create_task, Task, TaskClient};
}

pub use shim_sync::*;

#[cfg(feature = "async")]
pub mod shim_async {
    /// TTRPC client reexport for easier access.
    pub use ttrpc::asynchronous::Client;

    /// Shim events service.
    pub use crate::shim::events_ttrpc_async::{create_events, Events, EventsClient};
    /// Shim task service.
    pub use crate::shim::shim_ttrpc_async::{create_task, Task, TaskClient};
}

/// Reexport auto-generated public data structures.
pub mod api {
    pub use crate::shim::{empty::*, events::*, mount::*, shim::*, task::*};
}

#[cfg(feature = "sandbox")]
pub use sandbox::sandbox as sandbox_api;

#[cfg(feature = "sandbox")]
pub mod sandbox_sync {
    pub use crate::sandbox::sandbox_ttrpc::*;
}

#[cfg(all(feature = "sandbox", feature = "async"))]
pub mod sandbox_async {
    pub use crate::sandbox::sandbox_async::*;
}