node

package
v0.0.0-...-4f8ec59 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

type Container

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

type Edge

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

type JSON

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

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

func External(name string) (rv *Node)

func (*Node) FormatMeta

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

func (*Node) IsExternal

func (n *Node) IsExternal() bool

func (*Node) ToJSON

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

func (*Node) ToView

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

type Port

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

func (*Port) Equal

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

func (*Port) Label

func (p *Port) Label() string

func (*Port) UnmarshalJSON

func (p *Port) UnmarshalJSON(b []byte) (err error)

type PortMatcher

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

type Ports

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

func (*Ports) Add

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

func (*Ports) Compact

func (ps *Ports) Compact()

func (*Ports) Get

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

func (*Ports) Has

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

func (*Ports) HasAny

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

func (*Ports) Iter

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

func (*Ports) Join

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

func (*Ports) Len

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

type View

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

type Volume

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