-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
lib.rs
135 lines (126 loc) · 4.41 KB
/
lib.rs
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
//! Shiplift is a multi-transport utility for maneuvering [docker](https://www.docker.com/) containers
//!
//! # examples
//!
//! ```no_run
//! # async {
//! let docker = shiplift::Docker::new();
//!
//! match docker.images().list(&Default::default()).await {
//! Ok(images) => {
//! for image in images {
//! println!("{:?}", image.repo_tags);
//! }
//! },
//! Err(e) => eprintln!("Something bad happened! {}", e),
//! }
//! # };
//! ```
pub mod errors;
pub mod transport;
pub mod tty;
pub mod container;
pub mod docker;
pub mod exec;
pub mod image;
pub mod network;
pub mod service;
pub mod volume;
mod tarball;
#[cfg(feature = "chrono")]
mod datetime;
pub use hyper::Uri;
pub use crate::{
container::{
Container, ContainerFilter, ContainerListOptions, ContainerOptions, Containers,
LogsOptions, RmContainerOptions,
},
docker::{Docker, EventsOptions},
errors::{Error, Result},
exec::{Exec, ExecContainerOptions, ExecResizeOptions},
image::{
BuildOptions, Image, ImageFilter, ImageListOptions, Images, PullOptions, RegistryAuth,
TagOptions,
},
network::{
ContainerConnectionOptions, Network, NetworkCreateOptions, NetworkListOptions, Networks,
},
service::{Service, ServiceFilter, ServiceListOptions, ServiceOptions, Services},
transport::Transport,
volume::{Volume, VolumeCreateOptions, Volumes},
};
macro_rules! reexport {
(@alias $module:ident :: $item:ident) => {
reexport!(@alias $module::$item as $item);
};
(@alias $module:ident :: $item:ident as $old_item:ident) => {
::paste::paste! {
#[deprecated(
since = "0.8.0",
note = "Please use `shiplift::" $module "::" $item "`. "
"This will be removed in 0.9.0."
)]
pub type $old_item = $crate::$module::$item;
}
};
(mod $old_module:ident; $( $module:ident :: {$( $item:ident $(as $old_item:ident)? ),*$(,)?} ; )*) => {
#[deprecated(
since = "0.8.0",
note = "Please use `shiplift::{container, docker, exec, image, network, service, volume}` as appropriate. This will be removed in 0.9.0."
)]
pub mod $old_module {
$($( reexport!(@alias $module::$item $(as $old_item)?); )*)*
}
};
}
reexport! {
mod builder;
container::{
ContainerListOptions, ContainerListOptionsBuilder, ContainerOptions,
ContainerOptionsBuilder, LogsOptions, LogsOptionsBuilder, RmContainerOptions,
RmContainerOptionsBuilder,
};
docker::{EventsOptions, EventFilterType, EventFilter, EventsOptionsBuilder};
exec::{
ExecContainerOptions, ExecContainerOptionsBuilder, ExecResizeOptions,
ExecResizeOptionsBuilder,
};
image::{
RegistryAuth, RegistryAuthBuilder, TagOptions, TagOptionsBuilder, PullOptions,
PullOptionsBuilder, BuildOptions, BuildOptionsBuilder, ImageFilter, ImageListOptions,
ImageListOptionsBuilder,
};
network::{
NetworkListOptions, NetworkCreateOptions, NetworkCreateOptionsBuilder,
ContainerConnectionOptions, ContainerConnectionOptionsBuilder,
};
service::{
ServiceListOptions, ServiceFilter, ServiceListOptionsBuilder, ServiceOptions,
ServiceOptionsBuilder,
};
volume::{VolumeCreateOptions, VolumeCreateOptionsBuilder};
}
reexport! {
mod rep;
container::{
ContainerInfo as Container, ContainerDetails, Mount, State, HostConfig, Port, Stats,
MemoryStats, MemoryStat, NetworkStats as Network, CpuStats, CpuUsage, ThrottlingData, BlkioStats, BlkioStat, Change,
Top, ContainerCreateInfo, Exit,
};
docker::{Version, Info, Event, Actor};
exec::{ExecDetails, ProcessConfig};
image::{
SearchResult, ImageInfo as Image, ImageDetails, ContainerConfig, History, Status,
};
network::{
NetworkSettings, NetworkEntry, Ipam, NetworkDetails,
NetworkContainerDetails, NetworkCreateInfo,
};
service::{
ServicesInfo as Services, ServiceInfo as Service, ObjectVersion, Endpoint, EndpointSpec,
EndpointPortConfig, UpdateStatus, ServiceStatus, JobStatus, ServiceDetails, ServiceSpec,
TaskSpec, Mode, Replicated, ReplicatedJob, UpdateConfig, RollbackConfig,
NetworkAttachmentConfig, ServiceCreateInfo,
};
volume::{VolumeCreateInfo, VolumesInfo as Volumes, VolumeInfo as Volume};
}