Skip to content

Commit

Permalink
add ipam help content
Browse files Browse the repository at this point in the history
Signed-off-by: bingshen.wbs <[email protected]>
  • Loading branch information
BSWANG committed Feb 15, 2016
1 parent 43a6e81 commit 32fde5f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ A collection of helper packages to extend Docker Engine in Go
Authorization | [Link](https://docs.docker.com/engine/extend/authorization/) | Extend API authorization mechanism
Network | [Link](https://docs.docker.com/engine/extend/plugins_network/) | Extend network management
Volume | [Link](https://docs.docker.com/engine/extend/plugins_volume/) | Extend persistent storage
IPAM | [Link](https://github.com/docker/libnetwork/blob/master/docs/ipam.md) | Extend IP address management

See the [understand Docker plugins documentation section](https://docs.docker.com/engine/extend/plugins/).
31 changes: 31 additions & 0 deletions ipam/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Docker IPAM extension API

Go handler to create external IPAM extensions for Docker.

## Usage

This library is designed to be integrated in your program.

1. Implement the `ipam.Driver` interface.
2. Initialize a `ipam.Handler` with your implementation.
3. Call either `ServeTCP` or `ServeUnix` from the `ipam.Handler`.

### Example using TCP sockets:

```go
import "github.com/docker/go-plugins-helpers/ipam"

d := MyIPAMDriver{}
h := ipam.NewHandler(d)
h.ServeTCP("test_ipam", ":8080")
```

### Example using Unix sockets:

```go
import "github.com/docker/go-plugins-helpers/ipam"

d := MyIPAMDriver{}
h := ipam.NewHandler(d)
h.ServeUnix("root", "test_ipam")
```

0 comments on commit 32fde5f

Please sign in to comment.