client

package
v0.0.0-...-4f8ec59 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None         mode = 0
	InContainer  mode = 1
	LinuxNsenter mode = 2
)

Variables

View Source
var ErrModeNone = errors.New("mode not set")

Functions

func Inodes

func Inodes(
	pid int,
	cb func(uint64),
) error

func Nsenter

func Nsenter(
	pid int,
	proto graph.NetProto,
	onconn func(int, *graph.Connection),
) (
	err error,
)

Types

type Docker

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

func NewDocker

func NewDocker(opts ...Option) (rv *Docker, err error)

func (*Docker) Close

func (d *Docker) Close() (err error)

func (*Docker) Containers

func (d *Docker) Containers(
	ctx context.Context,
	proto graph.NetProto,
	deep bool,
	skipkeys []string,
	progress func(int, int),
) (rv []*graph.Container, err error)

func (*Docker) Mode

func (d *Docker) Mode() string

type DockerClient

type DockerClient interface {
	ContainerList(context.Context, container.ListOptions) ([]types.Container, error)
	ContainerInspect(context.Context, string) (types.ContainerJSON, error)
	ContainerExecCreate(context.Context, string, container.ExecOptions) (types.IDResponse, error)
	ContainerExecAttach(context.Context, string, container.ExecStartOptions) (types.HijackedResponse, error)
	ContainerTop(ctx context.Context, containerID string, arguments []string) (container.ContainerTopOKBody, error)
	Close() error
}

func Default

func Default() (rv DockerClient, err error)

type InodesMap

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

func (*InodesMap) AddInode

func (m *InodesMap) AddInode(containerID string, pid int, inode uint64)

func (*InodesMap) AddProcess

func (m *InodesMap) AddProcess(containerID string, pid int, name string)

func (*InodesMap) Has

func (m *InodesMap) Has(containerID string, pid int, inode uint64) (yes bool)

func (*InodesMap) MarkListener

func (m *InodesMap) MarkListener(containerID string, pid int, path string)

func (*InodesMap) MarkUnknown

func (m *InodesMap) MarkUnknown(containerID string, pid int, inode uint64)

func (*InodesMap) ResolveUnknown

func (m *InodesMap) ResolveUnknown(
	cb func(srcCID, dstCID, srcName, dstName, path string),
)

type Option

type Option func(*options)

func WithClientCreator

func WithClientCreator(c createClient) Option

func WithInodesFn

func WithInodesFn(f inodes) Option

func WithMode

func WithMode(m mode) Option

func WithNsenterFn

func WithNsenterFn(f nsenter) Option

Jump to

Keyboard shortcuts

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