forked from docker/go-plugins-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bingshen.wbs <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
``` |