Documentation
¶
Overview ¶
Package identd implements the RFC1413 identd server and oidentd config generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandHome ¶
ExpandHome mirrors server/helper.ts's expandHome. Kept as a thin re-export of internal/pathutil.ExpandHome (the now-canonical implementation - see that package's doc comment) so existing callers and this package's own tests don't need to change.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server mirrors identification.ts's Identification class.
func New ¶
New mirrors the constructor's oidentd-file half: if oidentdFile is non-empty (Config.values.oidentd, already expanded via ExpandHome by the caller), an initial (empty) oidentd file is written immediately, exactly like the TS constructor calling this.refresh() before any sockets exist. The RFC1413 listener half is started separately via ListenAndServe - split out because Go prefers returning errors over a callback, and because "should identd's own listener run" (Config.values.identd.enable) is an orthogonal decision from "is oidentd file generation configured".
func (*Server) AddSocket ¶
AddSocket mirrors Identification.addSocket: register a newly connected outbound socket under the given local username, returning an id for the matching RemoveSocket call once it closes.
func (*Server) ListenAndServe ¶
ListenAndServe mirrors the constructor's `Config.values.identd.enable` branch: binds the RFC1413 listener and serves connections until Close is called or Accept fails. Meant to be run in its own goroutine.
func (*Server) Refresh ¶
func (s *Server) Refresh()
Refresh mirrors Identification.refresh: regenerates the oidentd config file from every currently registered connection. A no-op (skips the write) when no oidentd file is configured, matching the TS `if (this.oidentdFile) { ... }` guard - the file contents are still built either way in Node, but there's nothing to build them for here if they're never written.
func (*Server) RemoveSocket ¶
RemoveSocket mirrors Identification.removeSocket.