graph

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEnough = errors.New("not enough items")

Functions

func Build

func Build(
	cli ContainerClient,
	grb Builder,
	knd NetProto,
	follow string,
	onlyLocal bool,
) 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 Loader

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

func NewLoader

func NewLoader(proto, follow string, local bool) *Loader

func (*Loader) Build

func (l *Loader) Build(b Builder) error

func (*Loader) LoadStream

func (l *Loader) LoadStream(r io.Reader) 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