Merge pull request #2 from dave-tucker/buildflags

Add Build Flags
This commit is contained in:
Vish Ishaya 2015-05-20 12:13:30 -07:00
commit 33a96b7b36
6 changed files with 15 additions and 6 deletions

View File

@ -12,6 +12,7 @@ import (
"fmt"
"syscall"
)
// NsHandle is a handle to a network namespace. It can be cast directly
// to an int and used as a file descriptor.
type NsHandle int

View File

@ -1,3 +1,5 @@
// +build linux
package netns
import (

View File

@ -1,3 +1,5 @@
// +build linux,386
package netns
const (

View File

@ -1,3 +1,5 @@
// +build linux,amd64
package netns
const (

View File

@ -1,3 +1,5 @@
// +build linux,arm
package netns
const (

View File

@ -10,26 +10,26 @@ var (
ErrNotImplemented = errors.New("not implemented")
)
func Set(ns Namespace) (err error) {
func Set(ns NsHandle) (err error) {
return ErrNotImplemented
}
func New() (ns Namespace, err error) {
func New() (ns NsHandle, err error) {
return -1, ErrNotImplemented
}
func Get() (Namespace, error) {
func Get() (NsHandle, error) {
return -1, ErrNotImplemented
}
func GetFromName(name string) (Namespace, error) {
func GetFromName(name string) (NsHandle, error) {
return -1, ErrNotImplemented
}
func GetFromPid(pid int) (Namespace, error) {
func GetFromPid(pid int) (NsHandle, error) {
return -1, ErrNotImplemented
}
func GetFromDocker(id string) (Namespace, error) {
func GetFromDocker(id string) (NsHandle, error) {
return -1, ErrNotImplemented
}