node

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v1.9.0

type Connection struct {
	Port *Port  `json:"port"`
	Src  string `json:"src"`
	Dst  string `json:"dst"`
}

type Container added in v1.9.0

type Container struct {
	Cmd    []string          `json:"cmd,omitempty"`
	Env    []string          `json:"env,omitempty"`
	Labels map[string]string `json:"labels"`
}

type Edge added in v1.9.0

type Edge struct {
	Port    *Port
	SrcID   string
	SrcName string
	DstID   string
	DstName string
}

type JSON added in v1.0.0

type JSON struct {
	Name       string                   `json:"name"`
	IsExternal bool                     `json:"is_external"`
	Image      *string                  `json:"image,omitempty"`
	Networks   []string                 `json:"networks"`
	Tags       []string                 `json:"tags"`
	Volumes    []*Volume                `json:"volumes"`
	Container  Container                `json:"container"`
	Listen     map[string][]*Port       `json:"listen"`
	Connected  map[string][]*Connection `json:"connected"`
}

type Meta added in v1.4.0

type Meta struct {
	Info string   `json:"info"`
	Docs string   `json:"docs"`
	Repo string   `json:"repo"`
	Tags []string `json:"tags"`
}

type Node

type Node struct {
	Container Container
	Meta      *Meta
	Ports     *Ports
	ID        string
	Name      string
	Image     string
	Cluster   string
	Networks  []string
	Volumes   []*Volume
}

func External added in v1.9.0

func External(name string) (rv *Node)

func (*Node) FormatMeta added in v1.7.7

func (n *Node) FormatMeta() (rv []string, ok bool)

func (*Node) IsExternal

func (n *Node) IsExternal() bool

func (*Node) ToJSON added in v1.0.0

func (n *Node) ToJSON() (rv *JSON)

func (*Node) ToView added in v1.6.4

func (n *Node) ToView() (rv *View)

type Port

type Port struct {
	Kind  string `json:"kind"`
	Value int    `json:"value"`
	Local bool   `json:"local"`
}

func (*Port) Equal added in v1.9.0

func (p *Port) Equal(v *Port) (yes bool)

func (*Port) Label

func (p *Port) Label() string

type PortMatcher added in v1.6.4

type PortMatcher interface {
	HasAny(...string) bool
	Has(...string) bool
}

type Ports added in v1.0.0

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

func (*Ports) Add added in v1.9.0

func (ps *Ports) Add(process string, p *Port)

func (*Ports) Compact added in v1.10.0

func (ps *Ports) Compact()

func (*Ports) Get added in v1.9.0

func (ps *Ports) Get(p *Port) (name string, ok bool)

func (*Ports) Has added in v1.6.4

func (ps *Ports) Has(label ...string) (yes bool)

func (*Ports) HasAny added in v1.6.4

func (ps *Ports) HasAny(label ...string) (yes bool)

func (*Ports) Iter added in v1.9.0

func (ps *Ports) Iter(it func(process string, p []*Port))

func (*Ports) Join added in v1.9.0

func (ps *Ports) Join(other *Ports)

func (*Ports) Len added in v1.9.0

func (ps *Ports) Len() (rv int)

type View added in v1.6.4

type View struct {
	Listen     PortMatcher
	Name       string
	Image      string
	Cmd        string
	Args       []string
	Tags       []string
	IsExternal bool
}

type Volume added in v1.5.0

type Volume struct {
	Type string `json:"type"`
	Src  string `json:"src"`
	Dst  string `json:"dst"`
}

Jump to

Keyboard shortcuts

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