Documentation
¶
Overview ¶
Package statsstore persists per-rule cumulative traffic counters to a JSON file with atomic writes, so daemon restarts do not lose upload, download, source-IP denial, or UDP protection totals. It only stores cumulative values; live connection counts and rates are not persisted.
Index ¶
Constants ¶
const DefaultFilename = "stats.json"
DefaultFilename is the state filename used when no explicit path is set.
Variables ¶
This section is empty.
Functions ¶
func ResolvePath ¶
ResolvePath returns the stats file path. Explicit relative paths are resolved beside the config file; otherwise a service state directory takes precedence over the config directory.
func SameFilePath ¶
SameFilePath reports whether two paths identify the same destination. It handles existing hard links and symlinks, plus not-yet-created files whose parent directory can be resolved.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes cumulative traffic counters at path.