File: interface.go

package info (click to toggle)
golang-github-containers-common 0.50.1%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,440 kB
  • sloc: makefile: 118; sh: 46
file content (19 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package util

import "github.com/containers/common/libnetwork/types"

// This is a helper package to allow code sharing between the different
// network interfaces.

// NetUtil is a helper interface which all network interfaces should implement to allow easy code sharing
type NetUtil interface {
	// ForEach eaxecutes the given function for each network
	ForEach(func(types.Network))
	// Len returns the number of networks
	Len() int
	// DefaultInterfaceName return the default interface name, this will be suffixed by a number
	DefaultInterfaceName() string
	// Network returns the network with the given name or ID.
	// It returns an error if the network is not found
	Network(nameOrID string) (*types.Network, error)
}