summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2023-04-28 01:45:15 +0200
committerSebastiaan van Stijn <github@gone.nl>2023-04-28 20:20:58 +0200
commit0ea41eaa51314fca8fa9b9d89f449901e2f86bae (patch)
treefbf733545d718161bd83d120fefa81557c59557d
parent021e89d702241f09ab9d7440b32a76688d713aad (diff)
downloaddocker-0ea41eaa51314fca8fa9b9d89f449901e2f86bae.tar.gz
libnetwork/osl: unify stubs for IfaceOption
Use the same signature for all platforms, but stub the nwIface type. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
-rw-r--r--libnetwork/osl/interface_freebsd.go4
-rw-r--r--libnetwork/osl/interface_linux.go3
-rw-r--r--libnetwork/osl/interface_unsupported.go6
-rw-r--r--libnetwork/osl/interface_windows.go4
-rw-r--r--libnetwork/osl/sandbox.go3
5 files changed, 9 insertions, 11 deletions
diff --git a/libnetwork/osl/interface_freebsd.go b/libnetwork/osl/interface_freebsd.go
deleted file mode 100644
index 9c0141fd9b..0000000000
--- a/libnetwork/osl/interface_freebsd.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package osl
-
-// IfaceOption is a function option type to set interface options
-type IfaceOption func()
diff --git a/libnetwork/osl/interface_linux.go b/libnetwork/osl/interface_linux.go
index 561e7fc7e0..ee1b4ab842 100644
--- a/libnetwork/osl/interface_linux.go
+++ b/libnetwork/osl/interface_linux.go
@@ -14,9 +14,6 @@ import (
"github.com/vishvananda/netns"
)
-// IfaceOption is a function option type to set interface options
-type IfaceOption func(i *nwIface)
-
type nwIface struct {
srcName string
dstName string
diff --git a/libnetwork/osl/interface_unsupported.go b/libnetwork/osl/interface_unsupported.go
new file mode 100644
index 0000000000..55a6ae73f1
--- /dev/null
+++ b/libnetwork/osl/interface_unsupported.go
@@ -0,0 +1,6 @@
+//go:build !linux
+// +build !linux
+
+package osl
+
+type nwIface struct{}
diff --git a/libnetwork/osl/interface_windows.go b/libnetwork/osl/interface_windows.go
deleted file mode 100644
index 9c0141fd9b..0000000000
--- a/libnetwork/osl/interface_windows.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package osl
-
-// IfaceOption is a function option type to set interface options
-type IfaceOption func()
diff --git a/libnetwork/osl/sandbox.go b/libnetwork/osl/sandbox.go
index 52117a4c05..f9448212c6 100644
--- a/libnetwork/osl/sandbox.go
+++ b/libnetwork/osl/sandbox.go
@@ -17,6 +17,9 @@ const (
SandboxTypeLoadBalancer = iota
)
+// IfaceOption is a function option type to set interface options.
+type IfaceOption func(i *nwIface)
+
// Sandbox represents a network sandbox, identified by a specific key. It
// holds a list of Interfaces, routes etc, and more can be added dynamically.
type Sandbox interface {