diff --git a/netns.go b/netns.go index 3878da3..2ca0fee 100644 --- a/netns.go +++ b/netns.go @@ -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 diff --git a/netns_linux.go b/netns_linux.go index 1cf5e13..c9170d6 100644 --- a/netns_linux.go +++ b/netns_linux.go @@ -1,3 +1,5 @@ +// +build linux + package netns import ( diff --git a/netns_linux_386.go b/netns_linux_386.go index 0a6fe49..1d769bb 100644 --- a/netns_linux_386.go +++ b/netns_linux_386.go @@ -1,3 +1,5 @@ +// +build linux,386 + package netns const ( diff --git a/netns_linux_amd.go b/netns_linux_amd64.go similarity index 64% rename from netns_linux_amd.go rename to netns_linux_amd64.go index bbf3f4d..b124666 100644 --- a/netns_linux_amd.go +++ b/netns_linux_amd64.go @@ -1,3 +1,5 @@ +// +build linux,amd64 + package netns const ( diff --git a/netns_linux_arm.go b/netns_linux_arm.go index e35cb07..fbf165e 100644 --- a/netns_linux_arm.go +++ b/netns_linux_arm.go @@ -1,3 +1,5 @@ +// +build linux,arm + package netns const ( diff --git a/netns_unspecified.go b/netns_unspecified.go index 42a804f..b2edc56 100644 --- a/netns_unspecified.go +++ b/netns_unspecified.go @@ -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 }