diff options
author | softprops <d.tangren@gmail.com> | 2015-04-30 23:32:41 -0400 |
---|---|---|
committer | softprops <d.tangren@gmail.com> | 2015-04-30 23:32:41 -0400 |
commit | 04de603226083c8fc41b1ceaa6150064d545bf8b (patch) | |
tree | 1b0b72a03eab97abdaeda193a1c339ee3915482c /src | |
parent | 20cb5d48abde956bdc9633a59d62af7f1e28978c (diff) |
docs
Diffstat (limited to 'src')
-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 |
5 files changed, 17 insertions, 4 deletions
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>>; |