From 42b9ae97eca7cf4370aaa8d6bd107ed7d5704084 Mon Sep 17 00:00:00 2001 From: zhangzeyi Date: Thu, 23 Mar 2023 10:39:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dip-hash=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E5=A4=B1=E6=95=88bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/service/factory.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/service/factory.go b/drivers/service/factory.go index ab6ce9a4..dd4ecdd3 100644 --- a/drivers/service/factory.go +++ b/drivers/service/factory.go @@ -3,6 +3,7 @@ package service import ( "github.com/eolinker/apinto/drivers" "github.com/eolinker/apinto/drivers/discovery/static" + ip_hash "github.com/eolinker/apinto/upstream/ip-hash" round_robin "github.com/eolinker/apinto/upstream/round-robin" "github.com/eolinker/eosc" ) @@ -15,13 +16,14 @@ var ( }) ) -//Register 注册service_http驱动工厂 +// Register 注册service_http驱动工厂 func Register(register eosc.IExtenderDriverRegister) { register.RegisterExtenderDriver(DriverName, NewFactory()) } -//NewFactory 创建service_http驱动工厂 +// NewFactory 创建service_http驱动工厂 func NewFactory() eosc.IExtenderDriverFactory { round_robin.Register() + ip_hash.Register() return drivers.NewFactory[Config](Create) } From 7c29408f5f1b778dd1b3b84babdd8ce8a73058a1 Mon Sep 17 00:00:00 2001 From: zhangzeyi Date: Tue, 28 Mar 2023 18:07:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djson=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=A4=A7=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/plugins/proxy-mirror/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/plugins/proxy-mirror/config.go b/drivers/plugins/proxy-mirror/config.go index b0b329c8..299304bd 100644 --- a/drivers/plugins/proxy-mirror/config.go +++ b/drivers/plugins/proxy-mirror/config.go @@ -6,7 +6,7 @@ import ( ) type Config struct { - Addr string `json:"Addr" label:"服务地址" description:"镜像服务地址, 需要包含scheme"` + Addr string `json:"addr" label:"服务地址" description:"镜像服务地址, 需要包含scheme"` SampleConf *SampleConfig `json:"sample_conf" label:"采样配置"` Timeout int `json:"timeout" label:"请求超时时间"` PassHost string `json:"pass_host" enum:"pass,node,rewrite" default:"pass" label:"转发域名" description:"请求发给上游时的 host 设置选型,pass:将客户端的 host 透传给上游,node:使用addr中配置的host,rewrite:使用下面指定的host值"` From 27a9313ab3c2ef4707c19db7035ad622ab13dd89 Mon Sep 17 00:00:00 2001 From: huangmengzhu Date: Fri, 31 Mar 2023 17:26:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?kafka=20config=20=E5=A2=9E=E5=8A=A0=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/output/kafka/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/output/kafka/config.go b/drivers/output/kafka/config.go index 954fb828..9c0d1899 100644 --- a/drivers/output/kafka/config.go +++ b/drivers/output/kafka/config.go @@ -21,10 +21,10 @@ type Config struct { Topic string `json:"topic" yaml:"topic" label:"Topic"` Address string `json:"address" yaml:"address" label:"请求地址"` Timeout int `json:"timeout" yaml:"timeout" label:"超时时间"` - Version string `json:"version" yaml:"version" label:"版本"` - PartitionType string `json:"partition_type" yaml:"partition_type"` - Partition int32 `json:"partition" yaml:"partition"` - PartitionKey string `json:"partition_key" yaml:"partition_key"` + Version string `json:"version" yaml:"version" label:"版本" default:"1.0.0.0" enum:"0.8.2.0, 0.8.2.1, 0.8.2.2, 0.9.0.0, 0.9.0.1, 0.10.0.0, 0.10.0.1, 0.10.1.0, 0.10.1.1, 0.10.2.0, 0.10.2.1, 0.10.2.2, 0.11.0.0, 0.11.0.1, 0.11.0.2, 1.0.0.0, 1.0.1.0, 1.0.2.0, 1.1.0.0, 1.1.1.0, 2.0.0.0, 2.0.1.0, 2.1.0.0, 2.1.1.0, 2.2.0.0, 2.2.1.0, 2.2.2.0, 2.3.0.0, 2.3.1.0, 2.4.0.0, 2.4.1.0, 2.5.0.0, 2.5.1.0, 2.6.0.0, 2.6.1.0, 2.6.2.0, 2.7.0.0, 2.7.1.0, 2.8.0.0, 2.8.1.0, 3.0.0.0, 3.1.0.0"` + PartitionType string `json:"partition_type" yaml:"partition_type" enum:"robin,hash,manual,random"` + Partition int32 `json:"partition" yaml:"partition" switch:"partition_type==='manual'"` + PartitionKey string `json:"partition_key" yaml:"partition_key" switch:"partition_type==='hash'"` Type string `json:"type" yaml:"type" enum:"json,line" label:"输出格式"` Formatter eosc.FormatterConfig `json:"formatter" yaml:"formatter" label:"格式化配置"` } From a55c1063c1b92dfe1fa72cd9f0bb9b4f700feccf Mon Sep 17 00:00:00 2001 From: huangmengzhu Date: Mon, 3 Apr 2023 11:14:12 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E5=AF=BC=E8=87=B4=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E7=9A=84=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/output/kafka/producer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/output/kafka/producer.go b/drivers/output/kafka/producer.go index 9ec31fe5..8c9ed988 100644 --- a/drivers/output/kafka/producer.go +++ b/drivers/output/kafka/producer.go @@ -21,7 +21,6 @@ type tProducer struct { conf *ProducerConfig cancel context.CancelFunc enable bool - locker *sync.Mutex formatter eosc.IFormatter } @@ -101,9 +100,9 @@ func (o *tProducer) write(msg *sarama.ProducerMessage) { if !o.enable { return } - o.locker.Lock() + o.input <- msg - o.locker.Unlock() + } func (o *tProducer) work() {