Versions in this module Expand all Collapse all v0 v0.1.0 Jan 5, 2026 Changes in this version + type AsyncConfig struct + BatchSize int + FlushPeriod time.Duration + Metrics Metrics + QueueSize int + Workers int + func DefaultAsyncConfig() *AsyncConfig + type AsyncTrafficStore interface + Flush func(ctx context.Context) error + QueueDepth func() int + type AsyncTrafficStoreWrapper struct + func NewAsyncTrafficStore(store TrafficStore, cfg *AsyncConfig) *AsyncTrafficStoreWrapper + func (w *AsyncTrafficStoreWrapper) Close() error + func (w *AsyncTrafficStoreWrapper) Flush(ctx context.Context) error + func (w *AsyncTrafficStoreWrapper) Handle(rec *capture.Record) + func (w *AsyncTrafficStoreWrapper) QueueDepth() int + func (w *AsyncTrafficStoreWrapper) Store(ctx context.Context, rec *capture.Record) error + func (w *AsyncTrafficStoreWrapper) StoreBatch(ctx context.Context, recs []*capture.Record) error + type CertCache interface + Clear func() + Close func() error + Delete func(host string) + Get func(host string) (*tls.Certificate, bool) + Set func(host string, cert *tls.Certificate) + type ConfigStore interface + Close func() error + DeleteProxyConfig func(ctx context.Context, proxyID string) error + GetProxyConfig func(ctx context.Context, proxyID string) (*ProxyConfig, error) + ListProxyConfigs func(ctx context.Context, orgID string) ([]*ProxyConfig, error) + SaveProxyConfig func(ctx context.Context, cfg *ProxyConfig) error + type DBConfig struct + DSN string + Database string + DriverName string + Host string + Password string + Path string + Port string + SSLMode string + Type DBType + User string + func ParseDatabaseURL(rawURL string) (*DBConfig, error) + func (c *DBConfig) String() string + type DBType string + const DBTypePostgres + const DBTypeSQLite + type DatabaseTrafficStore struct + func NewDatabaseTrafficStore(ctx context.Context, cfg *DatabaseTrafficStoreConfig) (*DatabaseTrafficStore, error) + func (s *DatabaseTrafficStore) Client() *ent.Client + func (s *DatabaseTrafficStore) Close() error + func (s *DatabaseTrafficStore) Count(ctx context.Context, filter *TrafficFilter) (int64, error) + func (s *DatabaseTrafficStore) GetByID(ctx context.Context, id string) (*TrafficDetail, error) + func (s *DatabaseTrafficStore) ProxyID() int + func (s *DatabaseTrafficStore) Query(ctx context.Context, filter *TrafficFilter) ([]*TrafficRecord, error) + func (s *DatabaseTrafficStore) Stats(ctx context.Context, filter *TrafficFilter) (*TrafficStats, error) + func (s *DatabaseTrafficStore) Store(ctx context.Context, rec *capture.Record) error + func (s *DatabaseTrafficStore) StoreBatch(ctx context.Context, recs []*capture.Record) error + type DatabaseTrafficStoreConfig struct + DatabaseURL string + Debug bool + Metrics Metrics + ProxyID int + ProxyName string + type DiscardTrafficStore struct + func (DiscardTrafficStore) Close() error + func (DiscardTrafficStore) Store(ctx context.Context, rec *capture.Record) error + func (DiscardTrafficStore) StoreBatch(ctx context.Context, recs []*capture.Record) error + type FileTrafficStore struct + func NewFileTrafficStore(cfg *FileTrafficStoreConfig) (*FileTrafficStore, error) + func (s *FileTrafficStore) Close() error + func (s *FileTrafficStore) Handle(rec *capture.Record) + func (s *FileTrafficStore) Store(ctx context.Context, rec *capture.Record) error + func (s *FileTrafficStore) StoreBatch(ctx context.Context, recs []*capture.Record) error + type FileTrafficStoreConfig struct + Format Format + Metrics Metrics + Path string + Writer io.Writer + type Format string + const FormatJSON + const FormatNDJSON + type LRUCertCache struct + func NewLRUCertCache(cfg *LRUCertCacheConfig) *LRUCertCache + func (c *LRUCertCache) Clear() + func (c *LRUCertCache) Close() error + func (c *LRUCertCache) Delete(host string) + func (c *LRUCertCache) Get(host string) (*tls.Certificate, bool) + func (c *LRUCertCache) Set(host string, cert *tls.Certificate) + func (c *LRUCertCache) Size() int + type LRUCertCacheConfig struct + Capacity int + Metrics Metrics + type MemoryCertCache struct + func NewMemoryCertCache(cfg *MemoryCertCacheConfig) *MemoryCertCache + func (c *MemoryCertCache) Clear() + func (c *MemoryCertCache) Close() error + func (c *MemoryCertCache) Delete(host string) + func (c *MemoryCertCache) Get(host string) (*tls.Certificate, bool) + func (c *MemoryCertCache) Set(host string, cert *tls.Certificate) + func (c *MemoryCertCache) Size() int + type MemoryCertCacheConfig struct + CleanupInterval time.Duration + Metrics Metrics + TTL time.Duration + type Metrics interface + IncCacheHit func() + IncCacheMiss func() + IncStoreError func() + IncStoreSuccess func() + ObserveStoreDuration func(d time.Duration) + SetQueueDepth func(n int) + type NoopMetrics struct + func (NoopMetrics) IncCacheHit() + func (NoopMetrics) IncCacheMiss() + func (NoopMetrics) IncStoreError() + func (NoopMetrics) IncStoreSuccess() + func (NoopMetrics) ObserveStoreDuration(time.Duration) + func (NoopMetrics) SetQueueDepth(int) + type ProxyConfig struct + Active bool + CreatedAt time.Time + ExcludeHosts []string + ExcludePaths []string + Host string + ID string + IncludeHosts []string + IncludePaths []string + MITMEnabled bool + Mode string + Name string + OrgID string + Port int + SkipBinary bool + SkipHosts []string + Slug string + UpdatedAt time.Time + Upstream string + type SamplingConfig struct + AlwaysCapture []string + NeverCapture []string + SampleRate float64 + type SamplingTrafficStore struct + func NewSamplingTrafficStore(store TrafficStore, cfg *SamplingConfig) *SamplingTrafficStore + func (s *SamplingTrafficStore) Close() error + func (s *SamplingTrafficStore) Store(ctx context.Context, rec *capture.Record) error + func (s *SamplingTrafficStore) StoreBatch(ctx context.Context, recs []*capture.Record) error + type TrafficDetail struct + ClientIP string + Query string + RequestBody string + RequestBodySize int64 + RequestContentType string + RequestHeaders map[string][]string + RequestIsBinary bool + ResponseBody string + ResponseBodySize int64 + ResponseContentType string + ResponseHeaders map[string][]string + ResponseIsBinary bool + Scheme string + StatusText string + TTFBMs *float64 + Tags []string + type TrafficFilter struct + Desc bool + EndTime time.Time + Hosts []string + Limit int + MaxStatus int + Methods []string + MinStatus int + Offset int + OrderBy string + Paths []string + StartTime time.Time + StatusCodes []int + type TrafficQuerier interface + Count func(ctx context.Context, filter *TrafficFilter) (int64, error) + GetByID func(ctx context.Context, id string) (*TrafficDetail, error) + Query func(ctx context.Context, filter *TrafficFilter) ([]*TrafficRecord, error) + Stats func(ctx context.Context, filter *TrafficFilter) (*TrafficStats, error) + type TrafficRecord struct + Duration time.Duration + Error string + Host string + ID string + Method string + Path string + StartTime time.Time + Status int + URL string + type TrafficStats struct + AvgDurationMs float64 + P50DurationMs float64 + P95DurationMs float64 + P99DurationMs float64 + RequestsByMethod map[string]int64 + RequestsByStatus map[int]int64 + TotalErrors int64 + TotalRequests int64 + UniqueHosts int64 + type TrafficStore interface + Close func() error + Store func(ctx context.Context, rec *capture.Record) error + StoreBatch func(ctx context.Context, recs []*capture.Record) error