Documentation
¶
Overview ¶
Package netgraph lays out the transport graph and serves it as a canvas page.
Index ¶
Constants ¶
View Source
const RefreshEvery = 15 * time.Minute
RefreshEvery is how long a layout is served before it is recomputed.
Variables ¶
This section is empty.
Functions ¶
func EngineLoader ¶
func EngineLoader(w http.ResponseWriter, r *http.Request)
EngineLoader serves the netview module's wasm_exec.js.
func EngineWasm ¶
func EngineWasm(w http.ResponseWriter, r *http.Request)
EngineWasm serves the netview module.
Types ¶
type Graph ¶
type Graph struct {
Nodes []string
X, Y []float64
// Degree is how many transports each visor has.
Degree []int
Types []string
Edges []Edge
// Transports is how many transports the graph was built from.
Transports int
// Group numbers each visor's group from 0, or is -1 for one alone.
// Nil when no groups were given. Groups is how many there are.
Group []int
Groups int
}
Graph is a laid out transport graph. Every pair of visors joined by at least one transport is one edge, with a bit set for each type joining them.
type Page ¶
type Page struct {
Title string
Back string
Source func(ctx context.Context) ([]Link, error)
// Marks, when set, colors some visors by key, and Legend names the colors.
Marks func(ctx context.Context) map[string]string
Legend []Mark
// Groups, when set, gives one key to visors that belong together. The
// page shows group numbers and sizes, never the keys, and GroupsAre says
// what a group shares, such as "one public IP".
Groups func(ctx context.Context) map[string]string
GroupsAre string
// contains filtered or unexported fields
}
Page serves the transport graph. Source returns the current transports, or an error while they are not known yet.
Click to show internal directories.
Click to hide internal directories.