twin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package twin provides network protocol digital twin modeling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	From      string `json:"from"`
	To        string `json:"to"`
	Bandwidth string `json:"bandwidth"`
	Latency   string `json:"latency"`
}

Link represents a network link.

type Model

type Model struct {
	Name  string `json:"name"`
	Nodes []Node `json:"nodes"`
	Links []Link `json:"links"`
}

Model represents a digital twin model.

func NewModel

func NewModel(name string) *Model

NewModel creates a new digital twin model.

func (m *Model) AddLink(from, to, bw, lat string)

AddLink adds a link.

func (*Model) AddNode

func (m *Model) AddNode(id, typ string, protocols []string)

AddNode adds a node.

func (*Model) Describe

func (m *Model) Describe() string

Describe returns a model description.

func (*Model) ToMermaid

func (m *Model) ToMermaid() string

ToMermaid generates a Mermaid network diagram.

func (*Model) WhatIf

func (m *Model) WhatIf(param, value string) string

WhatIf performs a what-if analysis by modifying a parameter.

type Node

type Node struct {
	ID        string   `json:"id"`
	Type      string   `json:"type"` // host, router, switch
	Protocols []string `json:"protocols"`
}

Node represents a network node in the digital twin.

Jump to

Keyboard shortcuts

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