container

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Enabled         bool   `yaml:"enabled,omitempty"`
	SocketPath      string `yaml:"socketPath,omitempty"`
	NetnsPathPrefix string `yaml:"netnsPathPrefix,omitempty"`
}

type CtrSpec

type CtrSpec struct {
	LinuxSpec LinuxSpec `yaml:"linux,omitempty"`
}

CtrSpec represent the output of ctr container info

type Handler

type Handler struct {
	v1.UnimplementedContainerDCaptureServiceServer

	ContainerDconfig Container

	SelectedNamespace string
	Captures          map[string]*pcap.PcapHandler
	// contains filtered or unexported fields
}

Handler Implement the CaptureHandler interface for containerd environnement It used containerd api to fetch the network namespace

func NewHandler

func NewHandler(config Container) (*Handler, error)

func (*Handler) Capture

Capture implement the capture grpc interface

func (*Handler) FetchNetorkNamespaceID

func (h *Handler) FetchNetorkNamespaceID(id string) (string, error)

FetchNetorkNamespaceID return the network namespace path

func (*Handler) SelectNamespace

func (h *Handler) SelectNamespace() error

SelectNamespace Select the containerD Namespace

func (*Handler) ServerInformation

func (s *Handler) ServerInformation() (*types.ServerInfo, error)

func (*Handler) SwitchNetworkNamespace

func (h *Handler) SwitchNetworkNamespace(path string) error

SwitchNetworkNamespace

type Info

type Info struct {
	Type string `yaml:"type,omitempty"`
	Path string `yaml:"path,omitempty"`
}

Info represent the Info part of ctr container info

type LinuxSpec

type LinuxSpec struct {
	Namespaces Namespaces `yaml:"namespaces,omitempty"`
}

LinuxSpec represent the LinuxSpec part of ctr container info

type Namespaces

type Namespaces []Info

Namespaces represent the Namespace part of ctr container info

Jump to

Keyboard shortcuts

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