core/recorder/recorder.go
kist fea73cf682 Update recorder.go
Changed functions name to MetadataRecordOption
2024-03-09 20:45:15 +08:00

40 lines
770 B
Go

package recorder
import (
"context"
)
type RecordOptions struct {
Metadata any
}
type RecordOption func(opts *RecordOptions)
func MetadataRecordOption(md any) RecordOption {
return func(opts *RecordOptions) {
opts.Metadata = md
}
}
type Recorder interface {
Record(ctx context.Context, b []byte, opts ...RecordOption) error
}
type RecorderObject struct {
Recorder Recorder
Record string
Options *Options
}
type Options struct {
Direction bool
TimestampFormat string
Hexdump bool
}
const (
RecorderServiceClientAddress = "recorder.service.client.address"
RecorderServiceRouterDialAddress = "recorder.service.router.dial.address"
RecorderServiceRouterDialAddressError = "recorder.service.router.dial.address.error"
)