graph

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 14 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(
	cfg *Config,
	cli ContainerClient,
) error

Types

type Builder

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

type Config added in v1.4.0

type Config struct {
	Builder   Builder
	Enricher  Enricher
	Follow    string
	Proto     NetProto
	OnlyLocal bool
	FullInfo  bool
	NoLoops   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 Connection

type Connection struct {
	LocalIP    net.IP
	RemoteIP   net.IP
	LocalPort  uint16
	RemotePort uint16
	Proto      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
	Process   *ProcessInfo
	Volumes   []*VolumeInfo
	// contains filtered or unexported fields
}

func (*Container) ConnectionsCount added in v1.4.7

func (ct *Container) ConnectionsCount() int

func (*Container) IterListeners added in v1.5.1

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

func (*Container) IterOutbounds added in v1.5.1

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

func (*Container) SetConnections

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

type ContainerClient

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

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) LoadStream

func (l *Loader) LoadStream(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 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 ProcessInfo added in v1.5.0

type ProcessInfo struct {
	Cmd []string
	Env []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