Add detailed godoc documentation to CLIEntry function

Expand the documentation comment for CLIEntry to provide more context
about what the function does, including its use of the fx dependency
injection framework, signal handling, and blocking behavior.
This commit is contained in:
2025-12-27 12:24:22 +07:00
parent 8323a95be9
commit e1d0ab5ea6
10 changed files with 110 additions and 29 deletions

View File

@@ -1,3 +1,5 @@
// Package database provides SQLite storage for BGP routing data including ASNs,
// prefixes, announcements, peerings, and live route tables.
package database
import (
@@ -5,7 +7,8 @@ import (
"time"
)
// Stats contains database statistics
// Stats contains database statistics including counts for ASNs, prefixes,
// peerings, peers, and live routes, as well as file size and prefix distribution data.
type Stats struct {
ASNs int
Prefixes int
@@ -19,7 +22,9 @@ type Stats struct {
IPv6PrefixDistribution []PrefixDistribution
}
// Store defines the interface for database operations
// Store defines the interface for database operations. It provides methods for
// managing ASNs, prefixes, announcements, peerings, BGP peers, and live routes.
// Implementations must be safe for concurrent use.
type Store interface {
// ASN operations
GetOrCreateASN(number int, timestamp time.Time) (*ASN, error)

View File

@@ -1,3 +1,4 @@
// Package database provides SQLite storage for BGP routing data.
package database
import (
@@ -6,7 +7,8 @@ import (
"github.com/google/uuid"
)
// ASN represents an Autonomous System Number
// ASN represents an Autonomous System Number with its metadata including
// handle, description, and first/last seen timestamps.
type ASN struct {
ASN int `json:"asn"`
Handle string `json:"handle"`