mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
5d9c59e523
- Also unexporting configuration structures in bridge - Changes in dnet/network.go to set bridge name = network name Signed-off-by: Alessandro Boch <aboch@docker.com>
26 lines
552 B
Go
26 lines
552 B
Go
package bridge
|
|
|
|
type setupStep func(*networkConfiguration, *bridgeInterface) error
|
|
|
|
type bridgeSetup struct {
|
|
config *networkConfiguration
|
|
bridge *bridgeInterface
|
|
steps []setupStep
|
|
}
|
|
|
|
func newBridgeSetup(c *networkConfiguration, i *bridgeInterface) *bridgeSetup {
|
|
return &bridgeSetup{config: c, bridge: i}
|
|
}
|
|
|
|
func (b *bridgeSetup) apply() error {
|
|
for _, fn := range b.steps {
|
|
if err := fn(b.config, b.bridge); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (b *bridgeSetup) queueStep(step setupStep) {
|
|
b.steps = append(b.steps, step)
|
|
}
|