Versions in this module Expand all Collapse all v0 v0.2.0 Mar 14, 2026 v0.1.0 Feb 7, 2026 Changes in this version + const Version + var ErrChannelClosed = errors.New("channel writer is closed") + func StreamNDJSON(r io.Reader) (<-chan IRRecord, <-chan error) + func WriteBatch(w io.Writer, records []IRRecord) error + func WriteFile(path string, records []IRRecord) error + func WriteNDJSON(w io.Writer, records []IRRecord) error + type AsyncNDJSONWriter struct + func NewAsyncNDJSONFileWriter(path string, opts ...AsyncWriterOption) (*AsyncNDJSONWriter, error) + func NewAsyncNDJSONWriter(writer *NDJSONWriter, opts ...AsyncWriterOption) *AsyncNDJSONWriter + func (w *AsyncNDJSONWriter) Close() error + func (w *AsyncNDJSONWriter) Count() int + func (w *AsyncNDJSONWriter) Flush() error + func (w *AsyncNDJSONWriter) Write(record *IRRecord) error + type AsyncWriterOption func(*AsyncNDJSONWriter) + func WithBufferSize(size int) AsyncWriterOption + func WithErrorHandler(handler ErrorHandler) AsyncWriterOption + type Batch struct + Metadata *BatchMetadata + Records []IRRecord + Version string + func NewBatch(records []IRRecord) *Batch + type BatchMetadata struct + GeneratedAt *time.Time + RecordCount int + Source string + type ChannelProvider struct + func Channel(opts ...ChannelProviderOption) *ChannelProvider + func (p *ChannelProvider) Chan() chan *IRRecord + func (p *ChannelProvider) NewReader(ctx context.Context, _ string) (IRReader, error) + func (p *ChannelProvider) NewStreamReader(_ io.Reader) (IRReader, error) + func (p *ChannelProvider) NewStreamWriter(_ io.Writer) IRWriter + func (p *ChannelProvider) NewWriter(ctx context.Context, _ string) (IRWriter, error) + type ChannelProviderOption func(*ChannelProvider) + func WithChannelProviderBufferSize(size int) ChannelProviderOption + func WithExistingChannel(ch chan *IRRecord) ChannelProviderOption + type ChannelReader struct + func NewChannelReader(ch <-chan *IRRecord) *ChannelReader + func NewChannelReaderFromWriter(w *ChannelWriter) *ChannelReader + func (r *ChannelReader) Close() error + func (r *ChannelReader) Read() (*IRRecord, error) + type ChannelWriter struct + func NewChannelWriter(opts ...ChannelWriterOption) *ChannelWriter + func NewChannelWriterWithChan(ch chan *IRRecord) *ChannelWriter + func (w *ChannelWriter) Channel() <-chan *IRRecord + func (w *ChannelWriter) Close() error + func (w *ChannelWriter) Flush() error + func (w *ChannelWriter) Write(record *IRRecord) error + type ChannelWriterOption func(*ChannelWriter) + func WithChannelBufferSize(size int) ChannelWriterOption + type ErrorHandler func(err error) + type GzipNDJSONOption func(*GzipNDJSONProvider) + func WithGzipCompressionLevel(level int) GzipNDJSONOption + type GzipNDJSONProvider struct + func GzipNDJSON(opts ...GzipNDJSONOption) *GzipNDJSONProvider + func (p *GzipNDJSONProvider) NewReader(ctx context.Context, path string) (IRReader, error) + func (p *GzipNDJSONProvider) NewStreamReader(r io.Reader) (IRReader, error) + func (p *GzipNDJSONProvider) NewStreamWriter(w io.Writer) IRWriter + func (p *GzipNDJSONProvider) NewWriter(ctx context.Context, path string) (IRWriter, error) + type GzipNDJSONReader struct + func NewGzipNDJSONFileReader(path string) (*GzipNDJSONReader, error) + func NewGzipNDJSONReader(r io.Reader) (*GzipNDJSONReader, error) + func (r *GzipNDJSONReader) Close() error + func (r *GzipNDJSONReader) LineNumber() int + func (r *GzipNDJSONReader) Read() (*IRRecord, error) + type GzipNDJSONWriter struct + func NewGzipNDJSONFileWriter(path string) (*GzipNDJSONWriter, error) + func NewGzipNDJSONFileWriterLevel(path string, level int) (*GzipNDJSONWriter, error) + func NewGzipNDJSONWriter(w io.Writer) *GzipNDJSONWriter + func NewGzipNDJSONWriterLevel(w io.Writer, level int) (*GzipNDJSONWriter, error) + func (w *GzipNDJSONWriter) Close() error + func (w *GzipNDJSONWriter) Count() int + func (w *GzipNDJSONWriter) Flush() error + func (w *GzipNDJSONWriter) Write(record *IRRecord) error + type GzipWriterOption func(*GzipNDJSONWriter) + func WithGzipLevel(level int) GzipWriterOption + type IRReader interface + Close func() error + Read func() (*IRRecord, error) + type IRRecord struct + DurationMs *float64 + Id *string + Request Request + Response Response + Source *IRRecordSource + Timestamp *time.Time + func NewRecord(method RequestMethod, path string, status int) *IRRecord + func ReadBatch(r io.Reader) ([]IRRecord, error) + func ReadDir(dir string) ([]IRRecord, error) + func ReadFile(path string) ([]IRRecord, error) + func ReadNDJSON(r io.Reader) ([]IRRecord, error) + func (j *IRRecord) UnmarshalJSON(value []byte) error + func (r *IRRecord) EffectivePathTemplate() string + func (r *IRRecord) MethodString() string + func (r *IRRecord) SetDuration(ms float64) *IRRecord + func (r *IRRecord) SetHost(host string) *IRRecord + func (r *IRRecord) SetID(id string) *IRRecord + func (r *IRRecord) SetPathTemplate(template string, params map[string]string) *IRRecord + func (r *IRRecord) SetQuery(query map[string]interface{}) *IRRecord + func (r *IRRecord) SetRequestBody(body interface{}) *IRRecord + func (r *IRRecord) SetResponseBody(body interface{}) *IRRecord + func (r *IRRecord) SetSource(source IRRecordSource) *IRRecord + func (r *IRRecord) SetTimestamp(t time.Time) *IRRecord + type IRRecordSource string + const IRRecordSourceHar + const IRRecordSourceLoggingTransport + const IRRecordSourceManual + const IRRecordSourcePlaywright + const IRRecordSourceProxy + func (j *IRRecordSource) UnmarshalJSON(value []byte) error + type IRWriter interface + Close func() error + Flush func() error + Write func(record *IRRecord) error + type LoggingOptions struct + AllowHosts []string + AllowMethods []string + FilterHeaders []string + IncludeRequestBody bool + IncludeResponseBody bool + MaxBodySize int64 + RequestIDHeaders []string + SampleRate float64 + SkipPaths []string + SkipStatusCodes []int + Source IRRecordSource + func DefaultLoggingOptions() LoggingOptions + type LoggingTransport struct + Base http.RoundTripper + ErrorHandler ErrorHandler + Options LoggingOptions + Writer IRWriter + func NewLoggingTransport(writer IRWriter, opts ...LoggingTransportOption) *LoggingTransport + func (t *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error) + type LoggingTransportOption func(*LoggingTransport) + func WithBase(base http.RoundTripper) LoggingTransportOption + func WithLoggingOptions(opts LoggingOptions) LoggingTransportOption + func WithTransportErrorHandler(handler ErrorHandler) LoggingTransportOption + type MultiWriter struct + func NewMultiWriter(writers ...IRWriter) (*MultiWriter, error) + func (w *MultiWriter) Close() error + func (w *MultiWriter) Flush() error + func (w *MultiWriter) Write(record *IRRecord) error + type NDJSONProvider struct + func NDJSON(opts ...ProviderOption) *NDJSONProvider + func (p *NDJSONProvider) NewReader(ctx context.Context, path string) (IRReader, error) + func (p *NDJSONProvider) NewStreamReader(r io.Reader) (IRReader, error) + func (p *NDJSONProvider) NewStreamWriter(w io.Writer) IRWriter + func (p *NDJSONProvider) NewWriter(ctx context.Context, path string) (IRWriter, error) + type NDJSONReader struct + func NewNDJSONFileReader(path string) (*NDJSONReader, error) + func NewNDJSONReader(r io.Reader) *NDJSONReader + func (r *NDJSONReader) Close() error + func (r *NDJSONReader) LineNumber() int + func (r *NDJSONReader) Read() (*IRRecord, error) + type NDJSONWriter struct + func NewNDJSONFileWriter(path string) (*NDJSONWriter, error) + func NewNDJSONWriter(w io.Writer) *NDJSONWriter + func (w *NDJSONWriter) Close() error + func (w *NDJSONWriter) Count() int + func (w *NDJSONWriter) Flush() error + func (w *NDJSONWriter) Write(record *IRRecord) error + type Provider interface + NewReader func(ctx context.Context, path string) (IRReader, error) + NewWriter func(ctx context.Context, path string) (IRWriter, error) + type ProviderOption func(*ProviderOptions) + func WithProviderBufferSize(size int) ProviderOption + type ProviderOptions struct + BufferSize int + func ApplyProviderOptions(opts ...ProviderOption) *ProviderOptions + type Request struct + Body interface{} + ContentType *string + Headers map[string]string + Host *string + Method RequestMethod + Path string + PathParams map[string]string + PathTemplate *string + Query map[string]interface{} + Scheme RequestScheme + func (j *Request) UnmarshalJSON(value []byte) error + type RequestMethod string + const RequestMethodDELETE + const RequestMethodGET + const RequestMethodHEAD + const RequestMethodOPTIONS + const RequestMethodPATCH + const RequestMethodPOST + const RequestMethodPUT + const RequestMethodTRACE + func (j *RequestMethod) UnmarshalJSON(value []byte) error + type RequestScheme string + const RequestSchemeHttp + const RequestSchemeHttps + func (j *RequestScheme) UnmarshalJSON(value []byte) error + type Response struct + Body interface{} + ContentType *string + Headers map[string]string + Status int + func (j *Response) UnmarshalJSON(value []byte) error + type SliceReader struct + func NewSliceReader(records []IRRecord) *SliceReader + func (r *SliceReader) Close() error + func (r *SliceReader) Len() int + func (r *SliceReader) Read() (*IRRecord, error) + func (r *SliceReader) Remaining() int + func (r *SliceReader) Reset() + type StorageProvider struct + func Storage(backend omnistorage.Backend, opts ...StorageProviderOption) *StorageProvider + func (p *StorageProvider) Backend() omnistorage.Backend + func (p *StorageProvider) NewReader(ctx context.Context, path string) (IRReader, error) + func (p *StorageProvider) NewWriter(ctx context.Context, path string) (IRWriter, error) + type StorageProviderOption func(*StorageProvider) + type StorageReader struct + func NewStorageReader(ctx context.Context, backend omnistorage.Backend, path string) (*StorageReader, error) + func (r *StorageReader) Close() error + func (r *StorageReader) LineNumber() int + func (r *StorageReader) Read() (*IRRecord, error) + type StorageWriter struct + func NewStorageWriter(ctx context.Context, backend omnistorage.Backend, path string) (*StorageWriter, error) + func (w *StorageWriter) Close() error + func (w *StorageWriter) Count() int + func (w *StorageWriter) Flush() error + func (w *StorageWriter) Write(record *IRRecord) error + type StreamProvider interface + NewStreamReader func(r io.Reader) (IRReader, error) + NewStreamWriter func(w io.Writer) IRWriter