add metadata option for recorder

This commit is contained in:
ginuerzh 2023-10-27 22:08:45 +08:00
parent 9e767d6745
commit d975ec3c74

View File

@ -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
}