diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Cargo.lock | 38 | ||||
-rw-r--r-- | src/bin/shiplft.rs (renamed from src/main.rs) | 6 | ||||
-rw-r--r-- | src/builder.rs | 3 | ||||
-rw-r--r-- | src/lib.rs | 7 | ||||
-rw-r--r-- | src/rep.rs | 2 | ||||
-rw-r--r-- | src/transport.rs | 3 |
7 files changed, 36 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml index e8faf69..7a907b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: rust script: - cargo build -- cargo test -- cargo bench - cargo doc --no-deps after_success: |- [ $TRAVIS_BRANCH = master ] && @@ -3,11 +3,11 @@ name = "shiplift" version = "0.0.1" dependencies = [ "httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "jed 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "unix_socket 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -19,11 +19,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cookie" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -35,7 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "gcc" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -45,16 +45,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hyper" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -67,7 +67,7 @@ name = "jed" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -119,21 +119,21 @@ dependencies = [ [[package]] name = "openssl" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "rustc-serialize" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -178,7 +178,7 @@ name = "time" version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -212,6 +212,6 @@ version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/src/main.rs b/src/bin/shiplft.rs index 67c975c..92cedf9 100644 --- a/src/main.rs +++ b/src/bin/shiplft.rs @@ -11,9 +11,9 @@ fn main() { //for i in docker.images().list().unwrap() { // println!("{:?}", i.RepoTags); //} - let mut ps = docker.containers(); - let mut c = ps.get("c60700a29d14"); - println!("container {:?}", c.inspect().unwrap()); + // let mut ps = docker.containers(); + //let mut c = ps.get("c60700a29d14"); + println!("container {:?}", docker.info()); //for i in jed::Iter::new(c.logs().unwrap()) { // println!("{:?}", i); //} diff --git a/src/builder.rs b/src/builder.rs index bea54f0..8b71392 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,3 +1,5 @@ +//! Interfaces for building [docker](https://www.docker.com/) containers + extern crate rustc_serialize; use self::super::Docker; @@ -7,6 +9,7 @@ use std::collections::BTreeMap; use std::io::Result; use rustc_serialize::json::{self, Json, ToJson}; +/// Interface for building a new docker container from an existing image pub struct ContainerBuilder<'a, 'b> { docker: &'a mut Docker, image: &'b str, @@ -1,4 +1,4 @@ -//! Shiplift maneuvering [docker](https://www.docker.com/) containers +//! Shiplift maneuvers [docker](https://www.docker.com/) containers //! //! # examples //! @@ -40,10 +40,12 @@ use transport::{ Body, Transport }; use unix_socket::UnixStream; use url::{ Host, RelativeSchemeData, SchemeData }; +/// Entrypoint interface for communicating with docker daemon pub struct Docker { transport: Box<Transport> } +/// Interface for accessing and manipulating a named docker image pub struct Image<'a, 'b> { docker: &'a mut Docker, name: &'b str @@ -68,6 +70,7 @@ impl<'a, 'b> Image<'a, 'b> { } } +/// Interface for docker images pub struct Images<'a> { docker: &'a mut Docker } @@ -96,6 +99,7 @@ impl<'a> Images<'a> { } } +/// Interface for accessing and manipulating a docker container pub struct Container<'a, 'b> { docker: &'a mut Docker, id: &'b str @@ -175,6 +179,7 @@ impl<'a, 'b> Container<'a, 'b> { // todo attach, attach/ws, } +/// Interface for docker containers pub struct Containers<'a> { docker: &'a mut Docker } @@ -1,3 +1,5 @@ +//! Rust representations of docker json structures + #[derive(Debug, RustcEncodable, RustcDecodable)] pub struct SearchResult { pub description: String, diff --git a/src/transport.rs b/src/transport.rs index 728215e..4ea78c9 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -1,3 +1,5 @@ +//! Transports for communicating with the docker daemon + extern crate hyper; extern crate mime; extern crate unix_socket; @@ -29,6 +31,7 @@ impl<'a> Body<'a> { } } +/// Primary interface for communicating with docker daemon pub trait Transport { fn request(&mut self, method: Method, endpoint: &str, body: Option<Body>) -> Result<String>; fn stream(&mut self, method: Method, endpoint: &str, body: Option<Body>) -> Result<Box<Read>>; |