graph

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessRemote  = "[remote]"
	ProcessUnknown = "[unknown]"
)

Variables

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

Functions

func Build

func Build(
	cfg *Config,
	cli ContainerClient,
) error

func ParseNetstat

func ParseNetstat(r io.Reader, cb func(*Connection)) (err error)

Types

type Builder

type Builder interface {
	AddNode(*node.Node) error
	AddEdge(*node.Edge)
}

type Compressor added in v1.10.0

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

func NewCompressor added in v1.10.0

func NewCompressor(
	bldr NamedBuilderWriter,
	diff int,
	force bool,
) *Compressor

func (*Compressor) AddEdge added in v1.10.0

func (c *Compressor) AddEdge(e *node.Edge)

func (*Compressor) AddNode added in v1.10.0

func (c *Compressor) AddNode(n *node.Node) error

func (*Compressor) Name added in v1.10.0

func (c *Compressor) Name() string

func (*Compressor) Write added in v1.10.0

func (c *Compressor) Write(w io.Writer) (err error)

type Config added in v1.4.0

type Config struct {
	Builder   Builder
	Meta      Enricher
	Follow    set.Unordered[string]
	SkipEnv   []string
	Proto     NetProto
	OnlyLocal bool
	FullInfo  bool
	NoLoops   bool
	Deep      bool
}

func (*Config) MatchName added in v1.4.0

func (c *Config) MatchName(v string) (yes bool)

func (*Config) MatchProto added in v1.4.0

func (c *Config) MatchProto(v string) (yes bool)

type ConnGroup added in v1.9.0

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

func (*ConnGroup) AddListener added in v1.9.0

func (cg *ConnGroup) AddListener(c *Connection)

func (*ConnGroup) AddOutbound added in v1.9.0

func (cg *ConnGroup) AddOutbound(c *Connection)

func (*ConnGroup) IterListeners added in v1.9.0

func (cg *ConnGroup) IterListeners(it func(*Connection))

func (*ConnGroup) IterOutbounds added in v1.9.0

func (cg *ConnGroup) IterOutbounds(it func(*Connection))

func (*ConnGroup) Len added in v1.9.0

func (cg *ConnGroup) Len() (rv int)

func (*ConnGroup) Sort added in v1.9.0

func (cg *ConnGroup) Sort()

type Connection

type Connection struct {
	Process    string
	LocalIP    net.IP
	RemoteIP   net.IP
	RemotePort uint16
	LocalPort  uint16
	Proto      NetProto
}

func (*Connection) IsInbound

func (c *Connection) IsInbound() bool

func (*Connection) IsListener

func (c *Connection) IsListener() bool

func (*Connection) IsLocal added in v1.10.0

func (c *Connection) IsLocal() bool

func (*Connection) UniqID added in v1.9.0

func (c *Connection) UniqID() (id uint64, ok bool)

type Container

type Container struct {
	Endpoints map[string]string
	Labels    map[string]string

	ID      string
	Name    string
	Image   string
	Info    *ContainerInfo
	Volumes []*VolumeInfo
	// contains filtered or unexported fields
}

func (*Container) AddConnection added in v1.9.0

func (c *Container) AddConnection(conn *Connection)

func (*Container) AddMany added in v1.9.0

func (c *Container) AddMany(conns []*Connection)

func (*Container) ConnectionsCount added in v1.4.7

func (c *Container) ConnectionsCount() (rv int)

func (*Container) IterListeners added in v1.5.1

func (c *Container) IterListeners(it func(*Connection))

func (*Container) IterOutbounds added in v1.5.1

func (c *Container) IterOutbounds(it func(*Connection))

func (*Container) SortConnections added in v1.9.0

func (c *Container) SortConnections()

func (*Container) ToNode added in v1.9.0

func (c *Container) ToNode() (rv *node.Node)

type ContainerClient

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

type ContainerInfo added in v1.9.0

type ContainerInfo struct {
	Cmd []string
	Env []string
}

type Enricher added in v1.4.0

type Enricher interface {
	Enrich(*node.Node)
}

type Loader

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

func NewLoader

func NewLoader(cfg *Config) *Loader

func (*Loader) Build

func (l *Loader) Build() error

func (*Loader) FromReader added in v1.7.4

func (l *Loader) FromReader(r io.Reader) error

type MetaLoader added in v1.4.0

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

func NewMetaLoader added in v1.4.0

func NewMetaLoader() *MetaLoader

func (*MetaLoader) Enrich added in v1.4.0

func (ex *MetaLoader) Enrich(n *node.Node)

func (*MetaLoader) FromReader added in v1.4.0

func (ex *MetaLoader) FromReader(r io.Reader) error

type NamedBuilderWriter added in v1.6.0

type NamedBuilderWriter interface {
	Builder
	NamedWriter
}

type NamedWriter added in v1.6.0

type NamedWriter interface {
	Name() string
	Write(io.Writer) 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

type VolumeInfo added in v1.5.0

type VolumeInfo struct {
	Type string
	Src  string
	Dst  string
}

Jump to

Keyboard shortcuts

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