add metadata option for recorder
This commit is contained in:
parent
9e767d6745
commit
d975ec3c74
@ -4,9 +4,18 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type RecordOptions struct{}
|
||||
type RecordOptions struct {
|
||||
Metadata any
|
||||
}
|
||||
|
||||
type RecordOption func(opts *RecordOptions)
|
||||
|
||||
func MetadataReocrdOption(md any) RecordOption {
|
||||
return func(opts *RecordOptions) {
|
||||
opts.Metadata = md
|
||||
}
|
||||
}
|
||||
|
||||
type Recorder interface {
|
||||
Record(ctx context.Context, b []byte, opts ...RecordOption) error
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user