add metadata option for recorder
This commit is contained in:
1 parent
9e767d6745
commit
d975ec3c74
1 file changed
+10
-1
+10
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user