MCPcopy
hub / github.com/txn2/kubefwd

github.com/txn2/kubefwd @v1.25.16 sqlite

repository ↗ · DeepWiki ↗ · release v1.25.16 ↗
3,005 symbols 13,747 edges 133 files 1,729 documented · 58%
README

Packaging

Testing

Run All Tests

go test ./...

Run Tests with Race Detector

IMPORTANT: Always run tests with race detector before releasing to catch concurrency bugs:

go test -race ./...

Run Specific Package Tests

# Auto-reconnect functionality tests
go test -v ./pkg/fwdport/...

# Service forwarding tests
go test -v ./pkg/fwdservice/...

# All tests with verbose output
go test -v ./...

Run Tests with Coverage

go test -cover ./...

Development

Build and Run

go run ./cmd/kubefwd/kubefwd.go

Local Build

go build -o kubefwd ./cmd/kubefwd/kubefwd.go

Release Process

Pre-Release Checklist

Before creating a release, ensure:

  1. ✅ All tests pass: go test ./...
  2. ✅ No race conditions: go test -race ./...
  3. ✅ GoReleaser config is valid: goreleaser check
  4. ✅ CHANGELOG is updated with new features and fixes
  5. ✅ Version numbers are updated appropriately

Build Test Release

Build test release locally without publishing:

goreleaser --snapshot --clean

Or with the older flag format:

goreleaser --skip-publish --rm-dist --skip-validate

Verify Test Build

After building test release:

# Check version
./dist/kubefwd_darwin_arm64/kubefwd version

# List built artifacts
ls -lh dist/

Build and Release

Create official release (requires GITHUB_TOKEN):

GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --clean

Or with older flag:

GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-dist

GoReleaser Configuration

The project uses GoReleaser v2 format. Configuration is in .goreleaser.yml.

Validate Configuration

goreleaser check

Available Build Targets

  • Linux: 386, amd64, arm, arm64
  • Darwin (macOS): amd64, arm64
  • Windows: 386, amd64, arm

Docker Images

Builds create Docker images: - txn2/kubefwd:latest (Alpine-based) - txn2/kubefwd:latest_ubuntu-20.04 (Ubuntu-based)

Package Formats

  • Archives: tar.gz (Linux/macOS), zip (Windows)
  • Linux packages: apk, deb, rpm
  • Homebrew formula (txn2/homebrew-tap)

Extension points exported contracts — how you extend this code

StateReader (Interface)
StateReader provides read-only access to forwarding state [6 implementers]
pkg/fwdapi/types/interfaces.go
RootChecker (Interface)
RootChecker determines if the process has administrative privileges. This interface allows mocking root checks for testi [2 …
pkg/utils/interface.go
InterfaceManager (Interface)
InterfaceManager handles loopback interface operations. This interface allows mocking network operations for testing. [2 …
pkg/fwdnet/interface.go
ServiceFWD (Interface)
ServiceFWD PodSyncer interface is used to represent a fwdservice.ServiceFWD reference, which cannot be used directly due [2 …
pkg/fwdport/fwdport.go
PodLogsStreamer (FuncType)
PodLogsStreamer is a function that streams pod logs from Kubernetes It returns an io.ReadCloser that streams log lines
pkg/fwdtui/ui.go
MetricsProvider (Interface)
MetricsProvider provides bandwidth and connection metrics [7 implementers]
pkg/fwdapi/types/interfaces.go
Handler (FuncType)
Handler is a function that handles events
pkg/fwdtui/events/bus.go
ServiceController (Interface)
ServiceController provides service lifecycle operations [8 implementers]
pkg/fwdapi/types/interfaces.go

Core symbols most depended-on inside this repo

Error
called by 698
pkg/fwdmcp/errors.go
String
called by 210
pkg/fwdport/fwdport.go
Close
called by 122
pkg/fwdmetrics/stream.go
Add
called by 102
pkg/fwdapi/logbuffer.go
NewStore
called by 95
pkg/fwdtui/state/store.go
AddForward
called by 88
pkg/fwdtui/state/store.go
Update
called by 75
pkg/fwdtui/ui.go
NewManager
called by 68
pkg/fwdns/manager.go

Shape

Function 1,746
Method 941
Struct 293
Interface 16
TypeAlias 6
FuncType 3

Languages

Go100%

Modules by API surface

pkg/fwdapi/handlers/handlers_test.go248 symbols
pkg/fwdtui/components/components_test.go141 symbols
pkg/fwdtui/tui_test.go126 symbols
pkg/fwdapi/adapters_test.go106 symbols
pkg/fwdmcp/httpclient.go104 symbols
pkg/fwdapi/manager_test.go98 symbols
pkg/fwdtui/components/browse_test.go94 symbols
pkg/fwdapi/adapters.go74 symbols
pkg/fwdmcp/httpclient_test.go66 symbols
pkg/fwdtui/components/detail.go64 symbols
pkg/fwdapi/types/types.go64 symbols
pkg/fwdtui/ui.go63 symbols

Dependencies from manifests, versioned

charm.land/bubbles/v2v2.1.0 · 1×
charm.land/bubbletea/v2v2.0.7 · 1×
charm.land/lipgloss/v2v2.0.4 · 1×
github.com/Azure/go-ansitermv0.0.0-2023012417243 · 1×
github.com/MakeNowJust/heredocv1.0.0 · 1×
github.com/atotto/clipboardv0.1.4 · 1×
github.com/bep/debouncev1.2.1 · 1×
github.com/blang/semver/v4v4.0.0 · 1×
github.com/bytedance/gopkgv0.1.3 · 1×
github.com/bytedance/sonicv1.15.0 · 1×
github.com/bytedance/sonic/loaderv0.5.0 · 1×
github.com/chai2010/gettext-gov1.0.2 · 1×

Datastores touched

(mongodb)Database · 1 repos
(mysql)Database · 1 repos
notificationsDatabase · 1 repos

For agents

$ claude mcp add kubefwd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact