cli

package
v0.0.0-...-6535452 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TabMetrics = iota
	TabLogs
	TabConfig
	MaxTabs = 3
)

Variables

This section is empty.

Functions

func ExecuteWithLogger

func ExecuteWithLogger(rootCmd *cobra.Command, logger *zap.Logger) error

ExecuteWithLogger executes the root command with proper error handling

func NewRootCommand

func NewRootCommand(ctx context.Context, logger *zap.Logger, version, commit, buildTime string) *cobra.Command

NewRootCommand creates the root command for the vanta CLI

func RunTUI

func RunTUI(cfg *config.Config, server *api.Server, logger *zap.Logger) error

RunTUI starts the TUI application

func SetupGracefulShutdown

func SetupGracefulShutdown(logger *zap.Logger) (context.Context, context.CancelFunc)

SetupGracefulShutdown configures graceful shutdown handling

Types

type ConfigEditor

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

type ConfigField

type ConfigField struct {
	Name        string
	Value       string
	Valid       bool
	Type        string // string, int, bool, duration
	Path        string // dot notation path to field
	Description string
}

type ConfigSaveMsg

type ConfigSaveMsg struct{}

type EndpointStats

type EndpointStats struct {
	Method    string  `json:"method"`
	Path      string  `json:"path"`
	RPS       float64 `json:"rps"`
	ErrorRate float64 `json:"error_rate"`
}

type LatencyStats

type LatencyStats struct {
	P50 time.Duration `json:"p50"`
	P90 time.Duration `json:"p90"`
	P95 time.Duration `json:"p95"`
	P99 time.Duration `json:"p99"`
}

type LogEntry

type LogEntry struct {
	Timestamp time.Time              `json:"timestamp"`
	Level     string                 `json:"level"`
	Component string                 `json:"component"`
	Message   string                 `json:"message"`
	Fields    map[string]interface{} `json:"fields,omitempty"`
}

type LogFilter

type LogFilter struct {
	Level     string // ALL, ERROR, WARN, INFO, DEBUG
	Component string // ALL or specific component
}

type LogUpdateMsg

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

type MetricsData

type MetricsData struct {
	RPS            float64         `json:"rps"`
	ErrorRate      float64         `json:"error_rate"`
	ActiveConns    int64           `json:"active_conns"`
	MemoryUsage    float64         `json:"memory_mb"`
	Uptime         time.Duration   `json:"uptime"`
	ChaosActive    bool            `json:"chaos_active"`
	Latency        LatencyStats    `json:"latency"`
	RequestHistory []float64       `json:"request_history"`
	TopEndpoints   []EndpointStats `json:"top_endpoints"`
	LastUpdated    time.Time       `json:"last_updated"`
}

type MetricsUpdateMsg

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

Messages

type TUIModel

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

func NewTUIModel

func NewTUIModel(cfg *config.Config, server *api.Server, logger *zap.Logger) *TUIModel

NewTUIModel creates a new TUI model

func (*TUIModel) Init

func (m *TUIModel) Init() tea.Cmd

Init implements tea.Model

func (*TUIModel) Update

func (m *TUIModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (*TUIModel) View

func (m *TUIModel) View() string

View implements tea.Model

Jump to

Keyboard shortcuts

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