feat: complete Rust-to-Go rewrite with Bubbletea v2

Rewrites oxker from Rust/ratatui to Go/Bubbletea, migrated to the
Bubbletea v2 API (charm.land/bubbletea/v2). Removes all original Rust
source files and legacy Go modules (internal/ui, internal/input, bubbles).

Key changes:
- View() returns tea.View with declarative AltScreen and MouseMode
- KeyMsg → KeyPressMsg, MouseMsg → MouseClickMsg/WheelMsg/MotionMsg/ReleaseMsg
- execWriteKey rewritten for v2 key fields (Code/Mod/Text)
- Mouse toggle via View field instead of imperative commands
- Filter/search text input uses msg.Text for v2 space key compat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Niko Syring
2026-03-12 03:41:14 +01:00
parent e020eb157c
commit d41761d6e9
224 changed files with 5140 additions and 26515 deletions
+29
View File
@@ -0,0 +1,29 @@
package utils
import (
"time"
)
type RateLimiter struct {
lastTime time.Time
minInterval time.Duration
}
func NewRateLimiter(interval time.Duration) *RateLimiter {
return &RateLimiter{
minInterval: interval,
}
}
func (r *RateLimiter) Allow() bool {
now := time.Now()
if now.Sub(r.lastTime) >= r.minInterval {
r.lastTime = now
return true
}
return false
}
func (r *RateLimiter) Reset() {
r.lastTime = time.Time{}
}
+31
View File
@@ -0,0 +1,31 @@
package utils
type ScrollDirection int
const (
ScrollUp ScrollDirection = iota
ScrollDown
ScrollPageUp
ScrollPageDown
ScrollHome
ScrollEnd
)
func (sd ScrollDirection) String() string {
switch sd {
case ScrollUp:
return "up"
case ScrollDown:
return "down"
case ScrollPageUp:
return "pageup"
case ScrollPageDown:
return "pagedown"
case ScrollHome:
return "home"
case ScrollEnd:
return "end"
default:
return "unknown"
}
}
+24
View File
@@ -0,0 +1,24 @@
package utils
type ContainerStats struct {
ID string
CPU float64
Memory uint64
MemoryLimit uint64
RX uint64
TX uint64
}
func ContainerStatsFromDocker(stats interface{}, id string) *ContainerStats {
var cpu float64
var mem, memLimit, rx, tx uint64
return &ContainerStats{
ID: id,
CPU: cpu,
Memory: mem,
MemoryLimit: memLimit,
RX: rx,
TX: tx,
}
}
+26
View File
@@ -0,0 +1,26 @@
package utils
import (
"strings"
"github.com/olekukonko/tablewriter"
)
func FormatTable(data [][]string) string {
var sb strings.Builder
table := tablewriter.NewWriter(&sb)
table.SetHeader([]string{})
table.SetBorder(false)
table.SetColMinWidth(0, 10)
table.SetColMinWidth(1, 20)
table.SetColMinWidth(2, 25)
table.SetColMinWidth(3, 15)
table.SetColMinWidth(4, 20)
for _, row := range data {
table.Append(row)
}
table.Render()
return sb.String()
}