mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-29 03:52:41 +02:00
chore: apply gofmt formatting
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
// Packet Structure:
|
||||
//
|
||||
// MHF packets follow this wire format:
|
||||
//
|
||||
// [2 bytes: Opcode][N bytes: Packet-specific data][2 bytes: Footer 0x00 0x10]
|
||||
//
|
||||
// Each packet type defines its own structure matching the binary format expected
|
||||
|
||||
@@ -311,4 +311,3 @@ func TestEmptyHandlers_NoDb(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ type ConnectionStats struct {
|
||||
// - v: Verbose output including objects and stage changes
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// runConnections([]string{"-stats"})
|
||||
// runConnections([]string{"-sessions", "-v"})
|
||||
// runConnections([]string{"-player", "Sarah", "-sessions"})
|
||||
|
||||
@@ -44,6 +44,7 @@ type ErrorGroup struct {
|
||||
// - detailed: Show detailed information including examples and extra data
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// runErrors([]string{"-summary"})
|
||||
// runErrors([]string{"-detailed", "-stack"})
|
||||
// runErrors([]string{"-group", "caller", "-limit", "20"})
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
// All filters are combined with AND logic.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// runFilter([]string{"-level", "error"})
|
||||
// runFilter([]string{"-since", "1h", "-logger", "channel-4*"})
|
||||
// runFilter([]string{"-msg", "connection reset", "-count"})
|
||||
@@ -137,6 +138,7 @@ func runFilter(args []string) {
|
||||
// - true if the string matches the pattern, false otherwise
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// matchWildcard("channel-4", "channel-*") // returns true
|
||||
// matchWildcard("main.channel-4.error", "*channel-4*") // returns true
|
||||
// matchWildcard("test", "foo*") // returns false
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
// - tail: Follow logs in real-time (like tail -f)
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// loganalyzer <command> [options]
|
||||
// loganalyzer filter -level error -since 1h
|
||||
// loganalyzer errors -summary
|
||||
|
||||
@@ -50,6 +50,7 @@ type LogEntry struct {
|
||||
// - An error if the file cannot be opened or read
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// entries, err := ParseLogFile("erupe.log")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
@@ -106,6 +107,7 @@ func ParseLogFile(filename string) ([]*LogEntry, error) {
|
||||
// - A LogEntry pointer containing the parsed data, or nil if the line is invalid
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// entry := ParseLogLine(`{"level":"info","ts":1762989571.547817,"msg":"Starting"}`)
|
||||
// fmt.Println(entry.Level, entry.Message)
|
||||
func ParseLogLine(line string) *LogEntry {
|
||||
@@ -201,6 +203,7 @@ func ParseLogLine(line string) *LogEntry {
|
||||
// - An error if the file cannot be opened, read, or if the callback returns an error
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// err := StreamLogFile("erupe.log", func(entry *LogEntry) error {
|
||||
// if entry.Level == "error" {
|
||||
// fmt.Println(entry.Message)
|
||||
@@ -259,6 +262,7 @@ func StreamLogFile(filename string, callback func(*LogEntry) error) error {
|
||||
// - A formatted string representation of the log entry
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// formatted := FormatLogEntry(entry, true)
|
||||
// fmt.Println(formatted)
|
||||
// // Output: 2025-11-12 23:19:31.546 INFO [main] Starting Erupe
|
||||
|
||||
@@ -49,6 +49,7 @@ type LogStats struct {
|
||||
// - detailed: Show detailed statistics including temporal patterns and top messages
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// runStats([]string{}) // Basic statistics
|
||||
// runStats([]string{"-detailed"}) // Full statistics with temporal analysis
|
||||
// runStats([]string{"-detailed", "-top", "20"}) // Show top 20 items
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
// The follow mode polls the file every 100ms for new content. Use Ctrl+C to stop.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// runTail([]string{}) // Show last 10 lines and follow
|
||||
// runTail([]string{"-n", "50"}) // Show last 50 lines and follow
|
||||
// runTail([]string{"-level", "error"}) // Only show errors
|
||||
|
||||
Reference in New Issue
Block a user