manager

package
v0.0.0-...-bd1a880 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package manager provides the implementation of the network service interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkManager

type NetworkManager struct {
	// contains filtered or unexported fields
}

NetworkManager implements the network.Service interface

func New

func New(options Options) (*NetworkManager, error)

New creates a new NetworkManager

func (*NetworkManager) Connect

func (m *NetworkManager) Connect(ctx context.Context, networkIDOrName, containerIDOrName string, options networkService.ConnectOptions) error

Connect connects a container to a network

func (*NetworkManager) Create

Create creates a new network

func (*NetworkManager) Disconnect

func (m *NetworkManager) Disconnect(ctx context.Context, networkIDOrName, containerIDOrName string, options networkService.DisconnectOptions) error

Disconnect disconnects a container from a network

func (*NetworkManager) FindNetworkByContainer

func (m *NetworkManager) FindNetworkByContainer(ctx context.Context, containerIDOrName string, options networkService.ListOptions) ([]*models.Network, error)

FindNetworkByContainer finds networks connected to a container

func (*NetworkManager) FindNetworkByName

func (m *NetworkManager) FindNetworkByName(ctx context.Context, pattern string, options networkService.ListOptions) ([]*models.Network, error)

FindNetworkByName finds networks by name pattern

func (*NetworkManager) FindNetworkBySubnet

func (m *NetworkManager) FindNetworkBySubnet(ctx context.Context, subnet string, options networkService.ListOptions) ([]*models.Network, error)

FindNetworkBySubnet finds networks by subnet

func (*NetworkManager) Get

func (m *NetworkManager) Get(ctx context.Context, idOrName string, options networkService.GetOptions) (*models.Network, error)

Get gets a network by ID or name

func (*NetworkManager) GetNetworkDrivers

func (m *NetworkManager) GetNetworkDrivers(ctx context.Context) ([]string, error)

GetNetworkDrivers returns the list of available network drivers

func (*NetworkManager) InspectRaw

func (m *NetworkManager) InspectRaw(ctx context.Context, idOrName string) (dockernetwork.Summary, error)

InspectRaw gets the raw information about a network

func (*NetworkManager) List

List lists networks

func (*NetworkManager) Prune

Prune removes unused networks

func (*NetworkManager) Remove

func (m *NetworkManager) Remove(ctx context.Context, idOrName string, options networkService.RemoveOptions) error

Remove removes a network

type Options

type Options struct {
	// Client is the Docker client
	Client *client.Client

	// Logger is the logger
	Logger *logrus.Logger
}

Options contains options for creating a NetworkManager

Jump to

Keyboard shortcuts

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