Documentation
¶
Overview ¶
Package dumper for internal debug use only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpStreamEvents ¶
func DumpStreamEvents(ctx context.Context, events []*httpclient.StreamEvent, filename string)
Types ¶
type Config ¶
type Config struct {
// Enabled enables or disables the dumper.
Enabled bool `conf:"enabled" yaml:"enabled" json:"enabled"`
// DumpPath is the directory path where data will be dumped.
DumpPath string `conf:"dump_path" yaml:"dump_path" json:"dump_path"`
// MaxSize is the maximum size of dump files in MB.
MaxSize int `conf:"max_size" yaml:"max_size" json:"max_size"`
// MaxAge is the maximum age of dump files to keep.
MaxAge time.Duration `conf:"max_age" yaml:"max_age" json:"max_age"`
// MaxBackups is the maximum number of old dump files to retain.
MaxBackups int `conf:"max_backups" yaml:"max_backups" json:"max_backups"`
}
Config holds the configuration for the dumper.
func DefaultConfig ¶
func DefaultConfig() Config
type Dumper ¶
type Dumper struct {
// contains filtered or unexported fields
}
Dumper is responsible for dumping data to files when errors occur.
func (*Dumper) DumpStreamEvents ¶
func (d *Dumper) DumpStreamEvents(ctx context.Context, events []*httpclient.StreamEvent, filename string)
DumpStreamEvents dumps a slice of interface{} as JSONL (JSON Lines) to a file.
Click to show internal directories.
Click to hide internal directories.