From 402b11b97b3a26f0c2e2bb674c5ebf878abdc1ea Mon Sep 17 00:00:00 2001 From: Piyush Singariya Date: Thu, 7 Nov 2024 16:10:54 +0530 Subject: [PATCH] minor rewrite --- protocol/writers.go | 4 ++-- types/adapter.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/writers.go b/protocol/writers.go index bd3e2c0..9420115 100644 --- a/protocol/writers.go +++ b/protocol/writers.go @@ -32,7 +32,7 @@ func NewWriter(ctx context.Context, config *types.WriterConfig) (*WriterPool, er } adapter := newfunc() - if err := utils.Unmarshal(config.AdapterConfig, adapter.GetConfigRef()); err != nil { + if err := utils.Unmarshal(config.WriterConfig, adapter.GetConfigRef()); err != nil { return nil, err } @@ -45,7 +45,7 @@ func NewWriter(ctx context.Context, config *types.WriterConfig) (*WriterPool, er return &WriterPool{ recordCount: atomic.Int64{}, threadCounter: atomic.Int64{}, - config: config.AdapterConfig, + config: config.WriterConfig, init: newfunc, group: group, groupCtx: ctx, diff --git a/types/adapter.go b/types/adapter.go index 6d9af8d..965e463 100644 --- a/types/adapter.go +++ b/types/adapter.go @@ -10,6 +10,6 @@ const ( // TODO: Add validations type WriterConfig struct { - Type AdapterType `json:"type"` - AdapterConfig any `json:"adapter"` + Type AdapterType `json:"type"` + WriterConfig any `json:"writer"` }