All checks were successful
check / check (push) Successful in 2m50s
Add comprehensive IRC numeric reply support: Connection registration (001-005): - 002 RPL_YOURHOST, 003 RPL_CREATED, 004 RPL_MYINFO, 005 RPL_ISUPPORT - All sent automatically during session creation after RPL_WELCOME Server statistics (251-255): - RPL_LUSERCLIENT, RPL_LUSEROP, RPL_LUSERCHANNELS, RPL_LUSERME - Sent during connection registration and via LUSERS command Channel operations: - MODE command: query channel modes (324 RPL_CHANNELMODEIS, 329 RPL_CREATIONTIME) - MODE command: query user modes (221 RPL_UMODEIS) - NAMES command: query channel member list (353/366) - LIST command: list all channels (322 RPL_LIST, 323 end of list) User queries: - WHOIS command: 311/312/318/319 numerics - WHO command: 352 RPL_WHOREPLY, 315 RPL_ENDOFWHO Database additions: - GetChannelCount, ListAllChannelsWithCounts - GetChannelCreatedAt, GetSessionCreatedAt Also adds StartTime to Globals for RPL_CREATED and updates README with comprehensive documentation of all new commands and numerics. closes #52
35 lines
658 B
Go
35 lines
658 B
Go
// Package globals provides shared global state for the application.
|
|
package globals
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
var (
|
|
// Appname is the global application name.
|
|
Appname string //nolint:gochecknoglobals
|
|
|
|
// Version is the global application version.
|
|
Version string //nolint:gochecknoglobals
|
|
)
|
|
|
|
// Globals holds application-wide metadata.
|
|
type Globals struct {
|
|
Appname string
|
|
Version string
|
|
StartTime time.Time
|
|
}
|
|
|
|
// New creates a new Globals instance from the global state.
|
|
func New(_ fx.Lifecycle) (*Globals, error) {
|
|
result := &Globals{
|
|
Appname: Appname,
|
|
Version: Version,
|
|
StartTime: time.Now(),
|
|
}
|
|
|
|
return result, nil
|
|
}
|