dockernetwork

package
v0.0.0-...-9109040 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DpsNetwork = "dps"

Variables

This section is empty.

Functions

func CreateOrUpdateDpsNetwork

func CreateOrUpdateDpsNetwork(ctx context.Context) (types.NetworkCreateResponse, error)

func DisconnectNetworkContainers

func DisconnectNetworkContainers(ctx context.Context, networkId string) []error

func FindBestIP

func FindBestIP(ctx context.Context, container types.ContainerJSON) string

func FindBestIpForNetworks

func FindBestIpForNetworks(ctx context.Context, container types.ContainerJSON, preferredNetworks ...string) string

func FindDockerNetworkNetworkGatewayIp

func FindDockerNetworkNetworkGatewayIp(ctx context.Context) (string, error)

func FindDpsContainer

func FindDpsContainer(ctx context.Context) (*types.Container, error)

func FindDpsContainerIP

func FindDpsContainerIP(ctx context.Context) (string, error)

func FindDpsNetwork

func FindDpsNetwork(ctx context.Context) (*types.NetworkResource, error)

func FindDpsNetworkGatewayIp

func FindDpsNetworkGatewayIp(ctx context.Context) (string, error)

func FindNetwork

func FindNetwork(ctx context.Context, args ...string) (*types.NetworkResource, error)

func FindNetworkByID

func FindNetworkByID(ctx context.Context, id string) (*types.NetworkResource, error)

func FindNetworkByName

func FindNetworkByName(ctx context.Context, name string) (*types.NetworkResource, error)

func FindNetworkGatewayIp

func FindNetworkGatewayIp(ctx context.Context, name string) (string, error)

func GetCli

func GetCli() client.APIClient

func GetGatewayIp

func GetGatewayIp(ctx context.Context) (string, error)

func GetIPFromNetworksMap

func GetIPFromNetworksMap(networks map[string]*network.EndpointSettings, key string) string

func GetNetworkGatewayIp

func GetNetworkGatewayIp(n *types.NetworkResource) string

func IsDockerConnected

func IsDockerConnected() bool

func ListNetworks

func ListNetworks(ctx context.Context, args ...string) ([]types.NetworkResource, error)

func MapValues

func MapValues(endpointsMap map[string]*network.EndpointSettings) []*network.EndpointSettings

func MustNetworkConnect

func MustNetworkConnect(ctx context.Context, networkId string, containerId string, networkIpAddress string)

func MustNetworkDisconnect

func MustNetworkDisconnect(ctx context.Context, networkId, containerId string)

func MustNetworkDisconnectForIp

func MustNetworkDisconnectForIp(ctx context.Context, networkName string, containerIP string)

func MustParseFlags

func MustParseFlags(flags ...string) filters.Args

func NetworkConnect

func NetworkConnect(ctx context.Context, networkId string, containerId string, networkIpAddress string) error

func SetCli

func SetCli(cli_ client.APIClient)

Types

type CompleteNetwork

type CompleteNetwork struct {
	IpAddress string
	NetworkId string
	Driver    string
}

type CompleteNetworkByDriver

type CompleteNetworkByDriver []*CompleteNetwork

func (CompleteNetworkByDriver) Len

func (a CompleteNetworkByDriver) Len() int

func (CompleteNetworkByDriver) Less

func (a CompleteNetworkByDriver) Less(i, j int) bool

func (CompleteNetworkByDriver) Swap

func (a CompleteNetworkByDriver) Swap(i, j int)

type MockApiClient

type MockApiClient struct {
	mock.Mock
	client.Client
}

func (*MockApiClient) CreateMockNetwork

func (*MockApiClient) CreateMockNetwork(ip string, id string) *network.EndpointSettings

func (*MockApiClient) NetworkList

func (m *MockApiClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL