The (*Sandbox).joinLeaveStart() and .joinLeaveEnd() methods implement an exclusive lock which is almost functionally identical to (*sync.Mutex).Lock() and .Unlock(), respectively. The only notable differences are that joinLeaveStart allocates, and calling joinLeaveEnd() more times than joinLeaveStart() is a silent no-op instead of a fatal error. The construction of the joinLeaveStart/End methods is shaped like a condition variable which uses channels for waiting and broadcasting. The condition being waited for is that the joinLeaveDone struct field is nil, i.e. that the lock has not been acquired by another goroutine. As the condition is being checked and set while in a critical section, it is a mutex implemented in terms of mutexes and channels. Replace the home-grown mutex with a plain sync.Mutex. Signed-off-by: Cory Snider <csnider@mirantis.com>
libnetwork - networking for containers
Libnetwork provides a native Go implementation for connecting containers
The goal of libnetwork is to deliver a robust Container Network Model that provides a consistent programming interface and the required network abstractions for applications.
Design
Please refer to the design for more information.
Using libnetwork
There are many networking solutions available to suit a broad range of use-cases. libnetwork uses a driver / plugin model to support all of these solutions while abstracting the complexity of the driver implementations by exposing a simple and consistent Network Model to users.
Contributing
Want to hack on libnetwork? Docker's contributions guidelines apply.
Copyright and license
Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.