netgraph

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	cli ContainerClient,
	grb Builder,
	knd NetProto,
	follow string,
) error

Types

type Builder

type Builder interface {
	AddNode(*node.Node) error
	AddEdge(string, string, node.Port)
}

type Connection

type Connection struct {
	LocalIP    net.IP
	RemoteIP   net.IP
	LocalPort  uint16
	RemotePort uint16
	Kind       NetProto
}

func ParseNetstat

func ParseNetstat(r io.Reader) (rv []*Connection, err error)

func (*Connection) IsInbound

func (cn *Connection) IsInbound() bool

func (*Connection) IsListener

func (cn *Connection) IsListener() bool

type Container

type Container struct {
	Endpoints map[string]string
	ID        string
	Name      string
	Image     string
	// contains filtered or unexported fields
}

func (*Container) ForEachListener

func (ct *Container) ForEachListener(it func(*Connection))

func (*Container) ForEachOutbound

func (ct *Container) ForEachOutbound(it func(*Connection))

func (*Container) Match

func (ct *Container) Match(v string) bool

func (*Container) SetConnections

func (ct *Container) SetConnections(conns []*Connection)

type ContainerClient

type ContainerClient interface {
	Containers(context.Context, NetProto, func(int, int)) ([]*Container, error)
}

type DockerClient

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

func NewDockerClient

func NewDockerClient() (rv *DockerClient, err error)

func (*DockerClient) Close

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

func (*DockerClient) Containers

func (d *DockerClient) Containers(
	ctx context.Context,
	kind NetProto,
	progress func(int, int),
) (rv []*Container, err error)

type NetProto

type NetProto byte
const (
	ALL NetProto = 0
	TCP NetProto = 1
	UDP NetProto = 2
)

func ParseNetProto

func ParseNetProto(val string) (p NetProto, ok bool)

func (NetProto) Flag

func (p NetProto) Flag() string

func (NetProto) String

func (p NetProto) String() string

Jump to

Keyboard shortcuts

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