capture

package
v0.71.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package capture bridges the util/capture package to JavaScript via syscall/js.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(client *netbird.Client, jsOpts js.Value) (js.Value, error)

Start creates a capture session and returns a JS interface for streaming text output. The returned object exposes:

onpacket(callback)  - set callback(string) for each text line
stop()              - stop capture and return stats { packets, bytes, dropped }

Options: { filter: string, verbose: bool, ascii: bool } or just a filter string.

Types

type Handle

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

Handle holds a running capture session so it can be stopped later.

func StartConsole

func StartConsole(client *netbird.Client, jsOpts js.Value) (*Handle, error)

StartConsole starts a capture that logs every packet line to console.log. Returns a Handle so the caller can stop it later.

func (*Handle) Stop

func (h *Handle) Stop() netbird.CaptureStats

Stop ends the capture and returns stats.

Jump to

Keyboard shortcuts

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