-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from mdelapenya/support-for-networking
(#73) Support attaching containers to different networks than bridge
- Loading branch information
Showing
5 changed files
with
277 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package testcontainers | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/docker/docker/api/types" | ||
) | ||
|
||
// NetworkProvider allows the creation of networks on an arbitrary system | ||
type NetworkProvider interface { | ||
CreateNetwork(context.Context, NetworkRequest) (Network, error) // create a network | ||
GetNetwork(context.Context, NetworkRequest) (types.NetworkResource, error) // get a network | ||
} | ||
|
||
// Network allows getting info about a single network instance | ||
type Network interface { | ||
Remove(context.Context) error // removes the network | ||
} | ||
|
||
// NetworkRequest represents the parameters used to get a network | ||
type NetworkRequest struct { | ||
Driver string | ||
CheckDuplicate bool | ||
Internal bool | ||
EnableIPv6 bool | ||
Name string | ||
Labels map[string]string | ||
Attachable bool | ||
|
||
SkipReaper bool // indicates whether we skip setting up a reaper for this | ||
} |