networkutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbbotExecFunc

type AbbotExecFunc func(
	ctx context.Context,
	env map[string]string,
	stdin io.Reader,
	stdout, stderr io.Writer,
) error

AbbotExecFunc execute abbot command with provided environment variables and io channels

type Client

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

func NewClient

func NewClient(exec AbbotExecFunc) *Client

func (*Client) CreateResolvConf

func (c *Client) CreateResolvConf(nameservers, searches, options []string) ([]byte, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, pid int64, containerID string) error

Delete container network by executing abbot command

func (*Client) Do

func (c *Client) Do(
	ctx context.Context,
	abbotReqData []byte,
	pid int64,
	containerID string,
) (abbotRespData []byte, err error)

Do host/container network operation by executing abbot command

func (*Client) Query

func (c *Client) Query(ctx context.Context, pid int64, containerID string) ([]byte, error)

Query container network by executing abbot command

func (*Client) Restore

func (c *Client) Restore(
	ctx context.Context, pid int64, containerID string,
) error

Restore container network by executing abbot command

Jump to

Keyboard shortcuts

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