add options for components

This commit is contained in:
ginuerzh
2023-10-26 22:20:10 +08:00
parent 33adbb9027
commit e5fa371586
21 changed files with 42 additions and 42 deletions

View File

@ -48,7 +48,7 @@ func NewGRPCPlugin(name string, addr string, opts ...plugin.Option) recorder.Rec
return p
}
func (p *grpcPlugin) Record(ctx context.Context, b []byte) error {
func (p *grpcPlugin) Record(ctx context.Context, b []byte, opts ...recorder.RecordOption) error {
if p.client == nil {
return nil
}
@ -98,13 +98,13 @@ func NewHTTPPlugin(name string, url string, opts ...plugin.Option) recorder.Reco
client: plugin.NewHTTPClient(&options),
header: options.Header,
log: logger.Default().WithFields(map[string]any{
"kind": "recorder",
"kind": "recorder",
"recorder": name,
}),
}
}
func (p *httpPlugin) Record(ctx context.Context, b []byte) error {
func (p *httpPlugin) Record(ctx context.Context, b []byte, opts ...recorder.RecordOption) error {
if len(b) == 0 || p.client == nil {
return nil
}