Factor an API out into a module
authorMichael Bridgen <mikeb@squaremobius.net>
Fri, 7 Aug 2015 15:27:52 +0000 (16:27 +0100)
committerMichael Bridgen <mikeb@squaremobius.net>
Wed, 16 Sep 2015 09:14:39 +0000 (10:14 +0100)
commit09a8148e3634e3c267d5ea2f8f2c5beb4eac9dca
treeb99c7b18197e5f0984a18c67463269d865c119e8
parent104e8b483e790485b674f114c5d7291bafc1887d
Factor an API out into a module

This takes some of the machinery from CNI and from the rkt networking
code, and turns it into a library that can be linked into go apps.

Included is an example command-line application that uses the library,
called `cnitool`.

Other headline changes:

 * Plugin exec'ing is factored out

The motivation here is to factor out the protocol for invoking
plugins. To that end, a generalisation of the code from api.go and
pkg/plugin/ipam.go goes into pkg/invoke/exec.go.

 * Move argument-handling and conf-loading into public API

The fact that the arguments get turned into an environment for the
plugin is incidental to the API; so, provide a way of supplying them
as a struct or saying "just use the same arguments as I got" (the
latter is for IPAM plugins).
invoke/args.go [new file with mode: 0644]
invoke/exec.go [new file with mode: 0644]
invoke/find.go [new file with mode: 0644]
ip/cidr.go
ipam/ipam.go [new file with mode: 0644]
plugin/ipam.go [deleted file]
skel/skel.go
types/args.go [moved from plugin/args.go with 56% similarity]
types/types.go [moved from plugin/types.go with 73% similarity]