mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
80809c42c6
- Addressed Arnaud's comments Signed-off-by: Alessandro Boch <aboch@socketplane.io>
31 lines
572 B
Go
31 lines
572 B
Go
package bridge
|
|
|
|
type SetupStep func(*Interface) error
|
|
|
|
type BridgeSetup struct {
|
|
bridge *Interface
|
|
steps []SetupStep
|
|
}
|
|
|
|
func NewBridgeSetup(i *Interface) *BridgeSetup {
|
|
return &BridgeSetup{bridge: i}
|
|
}
|
|
|
|
func (b *BridgeSetup) Apply() error {
|
|
for _, fn := range b.steps {
|
|
if err := fn(b.bridge); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (b *BridgeSetup) QueueStep(step SetupStep) {
|
|
b.steps = append(b.steps, step)
|
|
}
|
|
|
|
//---------------------------------------------------------------------------//
|
|
|
|
func SetupIPTables(i *Interface) error {
|
|
return nil
|
|
}
|