Versions in this module Expand all Collapse all v0 v0.1.0 Aug 20, 2026 Changes in this version + func CleanupOldDiskCacheFiles(maxAge time.Duration) error + func CreateDiskCacheFile(cacheType DiskCacheType) (string, *os.File, error) + func DecrementDiskFiles(size int64) + func DecrementMemoryBuffers(size int64) + func EnsureDiskCacheDir() error + func GetDiskCacheDir() string + func GetDiskCacheInfo() (fileCount int, totalSize int64, err error) + func GetDiskCacheMaxSizeBytes() int64 + func GetDiskCachePath() string + func GetDiskCacheThresholdBytes() int64 + func IncDBReconnect() + func IncDependencyFail() + func IncFileIOError() + func IncHTTP4xx() + func IncHTTP5xx() + func IncJWTVerifyFail() + func IncPanic() + func IncPreflightFail() + func IncSSLCertLoadFail() + func IncrementDiskCacheHits() + func IncrementDiskFiles(size int64) + func IncrementMemoryBuffers(size int64) + func IncrementMemoryCacheHits() + func IsDiskCacheAvailable(requestSize int64) bool + func IsDiskCacheEnabled() bool + func Monitor() + func ReadDiskCacheFile(filePath string) ([]byte, error) + func ReadDiskCacheFileString(filePath string) (string, error) + func RecordRuntimeTrend(p RuntimeTrendPoint) + func RemoveDiskCacheFile(filePath string) error + func ResetDiskCacheStats() + func ResetDiskCacheUsage() + func SafeSendBool(ch chan bool, value bool) (closed bool) + func SafeSendString(ch chan string, value string) (closed bool) + func SafeSendStringTimeout(ch chan string, value string, timeout int) (closed bool) + func SetDiskCacheConfig(config DiskCacheConfig) + func SetDiskPathProvider(p DiskPathProvider) + func SetGaugeSetter(s GaugeSetter) + func SetPProfDir(dir string) + func SetPerformanceMonitorConfig(config PerformanceMonitorConfig) + func ShouldSampleTrend() bool + func ShouldUseDiskCache(dataSize int64) bool + func StartPyroScope() error + func StartSystemMonitor() + func SyncDiskCacheStats() + func SyncPrometheusRuntimeGauges() + func TrendSampleInterval() time.Duration + func ValidateURLWithFetchSetting(urlStr string, enableSSRFProtection, allowPrivateIp bool, ...) error + func WriteDiskCacheFile(cacheType DiskCacheType, data []byte) (string, error) + func WriteDiskCacheFileString(cacheType DiskCacheType, data string) (string, error) + type CPUSnapshot struct + IdlePercent float64 + IowaitPercent float64 + NumCPU int + SystemPercent float64 + UsagePercent float64 + UserPercent float64 + type DiskCacheConfig struct + Enabled bool + MaxSizeMB int + Path string + ThresholdMB int + func GetDiskCacheConfig() DiskCacheConfig + type DiskCacheStats struct + ActiveDiskFiles int64 + ActiveMemoryBuffers int64 + CurrentDiskUsageBytes int64 + CurrentMemoryUsageBytes int64 + DiskCacheHits int64 + DiskCacheMaxBytes int64 + DiskCacheThresholdBytes int64 + MemoryCacheHits int64 + func GetDiskCacheStats() DiskCacheStats + type DiskCacheType string + const DiskCacheTypeBody + const DiskCacheTypeFile + type DiskPathProvider func() []string + type DiskPathUsage struct + Free uint64 + InodesFree uint64 + InodesTotal uint64 + InodesUsed uint64 + Path string + Total uint64 + Used uint64 + UsedPercent float64 + type DiskSpaceInfo struct + Free uint64 + Total uint64 + Used uint64 + UsedPercent float64 + func GetDiskSpaceInfo() DiskSpaceInfo + type GCSnapshot struct + GCCPUFraction float64 + GCPerMinute float64 + LastGCUnixNano int64 + NextGC uint64 + NumForcedGC uint32 + NumGC uint32 + PauseTotalMs float64 + PauseTotalNs uint64 + RecentPauseAvgMs float64 + RecentPauseMaxMs float64 + RecentPauseSamples int + type GaugeSetter func(name, help string, labels map[string]string, value float64) + type GoroutineSnapshot struct + ByState map[string]int + LeakSuspect bool + NumCgoCall int64 + NumGoroutine int + NumGoroutineMax int + NumThread int + type HostMemorySnapshot struct + Available uint64 + SwapPercent float64 + SwapTotal uint64 + SwapUsed uint64 + Total uint64 + Used uint64 + UsedPercent float64 + type HostSnapshot struct + CPU CPUSnapshot + Disks []DiskPathUsage + Load LoadSnapshot + Memory HostMemorySnapshot + Network NetSnapshot + Process ProcessSnapshot + func CollectHostSnapshot() HostSnapshot + type LoadSnapshot struct + Load1 float64 + Load15 float64 + Load5 float64 + type NetSnapshot struct + BytesRecv uint64 + BytesSent uint64 + DropIn uint64 + DropOut uint64 + ErrIn uint64 + ErrOut uint64 + PacketsRecv uint64 + PacketsSent uint64 + type OpsCounters struct + DBReconnectTotal uint64 + DependencyFailTotal uint64 + FileIOErrorTotal uint64 + HTTP4xxTotal uint64 + HTTP5xxTotal uint64 + JWTVerifyFailTotal uint64 + PanicTotal uint64 + PreflightFailTotal uint64 + SSLCertLoadFailTotal uint64 + func GetOpsCounters() OpsCounters + type PerformanceMonitorConfig struct + CPUThreshold int + DiskThreshold int + Enabled bool + MemoryThreshold int + func GetPerformanceMonitorConfig() PerformanceMonitorConfig + type ProcessSnapshot struct + CPUPercent float64 + CreateTimeUnix int64 + MaxFDs uint64 + NumThreads int32 + OpenFDs int32 + PID int32 + RSS uint64 + VMS uint64 + type RuntimeMemorySnapshot struct + Alloc uint64 + BuckHashSys uint64 + EnableGC bool + Frees uint64 + GCCPUFraction float64 + GCSys uint64 + HeapAlloc uint64 + HeapIdle uint64 + HeapInuse uint64 + HeapObjects uint64 + HeapReleased uint64 + HeapSys uint64 + LastGC uint64 + Lookups uint64 + MCacheInuse uint64 + MCacheSys uint64 + MSpanInuse uint64 + MSpanSys uint64 + Mallocs uint64 + NextGC uint64 + NumForcedGC uint32 + NumGC uint32 + OtherSys uint64 + PauseTotalNs uint64 + StackInuse uint64 + StackSys uint64 + Sys uint64 + TotalAlloc uint64 + type RuntimeSnapshot struct + GC GCSnapshot + GoVersion string + Goroutine GoroutineSnapshot + Memory RuntimeMemorySnapshot + func CollectRuntimeSnapshot() RuntimeSnapshot + type RuntimeTrendPoint struct + CPUUsage float64 + Goroutines int + HeapAlloc uint64 + HeapInuse uint64 + HeapObjects uint64 + MemoryUsage float64 + NumGC uint32 + ProcessRSS uint64 + Sys uint64 + Ts int64 + type RuntimeTrendSnapshot struct + IntervalSeconds int + PersistDir string + Points []RuntimeTrendPoint + Summary RuntimeTrendSummary + func GetRuntimeTrend(window string) RuntimeTrendSnapshot + type RuntimeTrendSummary struct + FirstTs int64 + GoroutineDelta int + GoroutineRising bool + HeapAllocDelta int64 + HeapAllocRising bool + LastTs int64 + SampleCount int + WindowMs int64 + type SSRFProtection struct + AllowPrivateIp bool + AllowedPorts []int + ApplyIPFilterForDomain bool + DomainFilterMode bool + DomainList []string + IpFilterMode bool + IpList []string + func (p *SSRFProtection) IsIPAccessAllowed(ip net.IP) bool + func (p *SSRFProtection) ValidateURL(urlStr string) error + type SystemStatus struct + CPUUsage float64 + DiskUsage float64 + MemoryUsage float64 + func GetSystemStatus() SystemStatus