Browse code

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>

Sebastiaan van Stijn authored on 2023/04/28 08:45:15
Showing 5 changed files
1 1
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-package osl
2
-
3
-// IfaceOption is a function option type to set interface options
4
-type IfaceOption func()
... ...
@@ -14,9 +14,6 @@ import (
14 14
 	"github.com/vishvananda/netns"
15 15
 )
16 16
 
17
-// IfaceOption is a function option type to set interface options
18
-type IfaceOption func(i *nwIface)
19
-
20 17
 type nwIface struct {
21 18
 	srcName     string
22 19
 	dstName     string
23 20
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+//go:build !linux
1
+// +build !linux
2
+
3
+package osl
4
+
5
+type nwIface struct{}
0 6
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-package osl
2
-
3
-// IfaceOption is a function option type to set interface options
4
-type IfaceOption func()
... ...
@@ -17,6 +17,9 @@ const (
17 17
 	SandboxTypeLoadBalancer = iota
18 18
 )
19 19
 
20
+// IfaceOption is a function option type to set interface options.
21
+type IfaceOption func(i *nwIface)
22
+
20 23
 // Sandbox represents a network sandbox, identified by a specific key.  It
21 24
 // holds a list of Interfaces, routes etc, and more can be added dynamically.
22 25
 type Sandbox interface {