From 3c9ef94d76bd37139511deb024197035494b8033 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 11 Nov 2020 10:34:08 +0800 Subject: [PATCH] modified typo word Resovler to Resolver --- consumer/option.go | 4 ++-- consumer/push_consumer_test.go | 2 +- docs/Introduction.md | 2 +- examples/consumer/acl/main.go | 2 +- examples/consumer/broadcast/main.go | 2 +- examples/consumer/delay/main.go | 2 +- examples/consumer/interceptor/main.go | 2 +- examples/consumer/namespace/main.go | 2 +- examples/consumer/orderly/main.go | 2 +- examples/consumer/pull/main.go | 2 +- examples/consumer/retry/concurrent/main.go | 2 +- examples/consumer/retry/order/main.go | 2 +- examples/consumer/simple/main.go | 2 +- examples/consumer/strategy/main.go | 2 +- examples/consumer/tag/main.go | 2 +- examples/consumer/trace/main.go | 2 +- examples/producer/acl/main.go | 2 +- examples/producer/async/main.go | 2 +- examples/producer/batch/main.go | 2 +- examples/producer/delay/main.go | 2 +- examples/producer/interceptor/main.go | 2 +- examples/producer/namespace/main.go | 2 +- examples/producer/simple/main.go | 2 +- examples/producer/tag/main.go | 2 +- examples/producer/trace/main.go | 2 +- examples/producer/transaction/main.go | 2 +- producer/option.go | 4 ++-- producer/producer_test.go | 8 ++++---- 28 files changed, 33 insertions(+), 33 deletions(-) diff --git a/consumer/option.go b/consumer/option.go index 07b4246a..330f6c4f 100644 --- a/consumer/option.go +++ b/consumer/option.go @@ -254,8 +254,8 @@ func WithPullInterval(interval time.Duration) Option { } } -// WithNsResovler set nameserver resolver to fetch nameserver addr -func WithNsResovler(resolver primitive.NsResolver) Option { +// WithNsResolver set nameserver resolver to fetch nameserver addr +func WithNsResolver(resolver primitive.NsResolver) Option { return func(options *consumerOptions) { options.Resolver = resolver } diff --git a/consumer/push_consumer_test.go b/consumer/push_consumer_test.go index 7cb5fcaa..4789e9b1 100644 --- a/consumer/push_consumer_test.go +++ b/consumer/push_consumer_test.go @@ -36,7 +36,7 @@ func TestStart(t *testing.T) { Convey("test Start method", t, func() { c, _ := NewPushConsumer( WithGroupName("testGroup"), - WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), WithConsumerModel(BroadCasting), ) diff --git a/docs/Introduction.md b/docs/Introduction.md index f5b8e12f..dd86c905 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -30,7 +30,7 @@ Producer interface { ``` p, err := rocketmq.NewProducer( producer.WithNameServer(endPoint), - //producer.WithNsResovler(primitive.NewPassthroughResolver(endPoint)), + //producer.WithNsResolver(primitive.NewPassthroughResolver(endPoint)), producer.WithRetry(2), producer.WithGroupName("GID_xxxxxx"), ) diff --git a/examples/consumer/acl/main.go b/examples/consumer/acl/main.go index a6535fdb..96d0dd03 100644 --- a/examples/consumer/acl/main.go +++ b/examples/consumer/acl/main.go @@ -31,7 +31,7 @@ import ( func main() { c, err := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithCredentials(primitive.Credentials{ AccessKey: "RocketMQ", SecretKey: "12345678", diff --git a/examples/consumer/broadcast/main.go b/examples/consumer/broadcast/main.go index 29b0b120..219ab3ed 100644 --- a/examples/consumer/broadcast/main.go +++ b/examples/consumer/broadcast/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset), consumer.WithConsumerModel(consumer.BroadCasting), ) diff --git a/examples/consumer/delay/main.go b/examples/consumer/delay/main.go index 8cc5c04b..1bbe6edb 100644 --- a/examples/consumer/delay/main.go +++ b/examples/consumer/delay/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), ) err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) { diff --git a/examples/consumer/interceptor/main.go b/examples/consumer/interceptor/main.go index 1036c6a9..83f43b09 100644 --- a/examples/consumer/interceptor/main.go +++ b/examples/consumer/interceptor/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithConsumerModel(consumer.Clustering), consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset), consumer.WithInterceptor(UserFistInterceptor(), UserSecondInterceptor())) diff --git a/examples/consumer/namespace/main.go b/examples/consumer/namespace/main.go index e1b9deaf..d46f2107 100644 --- a/examples/consumer/namespace/main.go +++ b/examples/consumer/namespace/main.go @@ -31,7 +31,7 @@ import ( func main() { c, err := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithCredentials(primitive.Credentials{ AccessKey: "RocketMQ", SecretKey: "12345678", diff --git a/examples/consumer/orderly/main.go b/examples/consumer/orderly/main.go index 9e7a810a..0f33e5f9 100644 --- a/examples/consumer/orderly/main.go +++ b/examples/consumer/orderly/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithConsumerModel(consumer.Clustering), consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset), consumer.WithConsumerOrder(true), diff --git a/examples/consumer/pull/main.go b/examples/consumer/pull/main.go index d740b154..3d49e7e5 100644 --- a/examples/consumer/pull/main.go +++ b/examples/consumer/pull/main.go @@ -31,7 +31,7 @@ import ( func main() { c, err := rocketmq.NewPullConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), ) if err != nil { rlog.Fatal(fmt.Sprintf("fail to new pullConsumer: %s", err), nil) diff --git a/examples/consumer/retry/concurrent/main.go b/examples/consumer/retry/concurrent/main.go index 5fcf489b..49f16d15 100644 --- a/examples/consumer/retry/concurrent/main.go +++ b/examples/consumer/retry/concurrent/main.go @@ -37,7 +37,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithConsumerModel(consumer.Clustering), ) diff --git a/examples/consumer/retry/order/main.go b/examples/consumer/retry/order/main.go index 4ec05e71..e2d13bf9 100644 --- a/examples/consumer/retry/order/main.go +++ b/examples/consumer/retry/order/main.go @@ -36,7 +36,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithConsumerModel(consumer.Clustering), consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset), consumer.WithConsumerOrder(true), diff --git a/examples/consumer/simple/main.go b/examples/consumer/simple/main.go index 7d1a0b72..70f35b3b 100644 --- a/examples/consumer/simple/main.go +++ b/examples/consumer/simple/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), ) err := c.Subscribe("test", consumer.MessageSelector{}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) { diff --git a/examples/consumer/strategy/main.go b/examples/consumer/strategy/main.go index 502524cb..269ce111 100644 --- a/examples/consumer/strategy/main.go +++ b/examples/consumer/strategy/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithStrategy(consumer.AllocateByAveragely), ) err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context, diff --git a/examples/consumer/tag/main.go b/examples/consumer/tag/main.go index 0532971f..ec16f510 100644 --- a/examples/consumer/tag/main.go +++ b/examples/consumer/tag/main.go @@ -31,7 +31,7 @@ import ( func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), ) selector := consumer.MessageSelector{ Type: consumer.TAG, diff --git a/examples/consumer/trace/main.go b/examples/consumer/trace/main.go index 4daaa9f2..97f22ed8 100644 --- a/examples/consumer/trace/main.go +++ b/examples/consumer/trace/main.go @@ -37,7 +37,7 @@ func main() { c, _ := rocketmq.NewPushConsumer( consumer.WithGroupName("testGroup"), - consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), consumer.WithTrace(traceCfg), ) err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context, diff --git a/examples/producer/acl/main.go b/examples/producer/acl/main.go index 38d61dcd..96881d39 100644 --- a/examples/producer/acl/main.go +++ b/examples/producer/acl/main.go @@ -30,7 +30,7 @@ import ( func main() { p, err := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), producer.WithCredentials(primitive.Credentials{ AccessKey: "RocketMQ", diff --git a/examples/producer/async/main.go b/examples/producer/async/main.go index aa738811..2a5182cd 100644 --- a/examples/producer/async/main.go +++ b/examples/producer/async/main.go @@ -31,7 +31,7 @@ import ( // Package main implements a async producer to send message. func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), producer.WithQueueSelector(producer.NewManualQueueSelector())) diff --git a/examples/producer/batch/main.go b/examples/producer/batch/main.go index d807daf4..dc591a11 100644 --- a/examples/producer/batch/main.go +++ b/examples/producer/batch/main.go @@ -30,7 +30,7 @@ import ( func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), ) err := p.Start() diff --git a/examples/producer/delay/main.go b/examples/producer/delay/main.go index 465e97cc..aadbb703 100644 --- a/examples/producer/delay/main.go +++ b/examples/producer/delay/main.go @@ -29,7 +29,7 @@ import ( func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), ) err := p.Start() diff --git a/examples/producer/interceptor/main.go b/examples/producer/interceptor/main.go index 47ea1fb8..c40f9a0f 100644 --- a/examples/producer/interceptor/main.go +++ b/examples/producer/interceptor/main.go @@ -30,7 +30,7 @@ import ( func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), producer.WithInterceptor(UserFirstInterceptor(), UserSecondInterceptor()), ) diff --git a/examples/producer/namespace/main.go b/examples/producer/namespace/main.go index 524bd320..9124284d 100644 --- a/examples/producer/namespace/main.go +++ b/examples/producer/namespace/main.go @@ -30,7 +30,7 @@ import ( func main() { p, err := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), producer.WithCredentials(primitive.Credentials{ AccessKey: "RocketMQ", diff --git a/examples/producer/simple/main.go b/examples/producer/simple/main.go index 8ac44219..6fd33642 100644 --- a/examples/producer/simple/main.go +++ b/examples/producer/simple/main.go @@ -31,7 +31,7 @@ import ( // Package main implements a simple producer to send message. func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), ) err := p.Start() diff --git a/examples/producer/tag/main.go b/examples/producer/tag/main.go index 2bcd51ba..7ce85598 100644 --- a/examples/producer/tag/main.go +++ b/examples/producer/tag/main.go @@ -29,7 +29,7 @@ import ( func main() { p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), ) err := p.Start() diff --git a/examples/producer/trace/main.go b/examples/producer/trace/main.go index e6a25a99..b7417046 100644 --- a/examples/producer/trace/main.go +++ b/examples/producer/trace/main.go @@ -36,7 +36,7 @@ func main() { } p, _ := rocketmq.NewProducer( - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(2), producer.WithTrace(traceCfg)) err := p.Start() diff --git a/examples/producer/transaction/main.go b/examples/producer/transaction/main.go index dde39a9c..05b6c527 100644 --- a/examples/producer/transaction/main.go +++ b/examples/producer/transaction/main.go @@ -79,7 +79,7 @@ func (dl *DemoListener) CheckLocalTransaction(msg *primitive.MessageExt) primiti func main() { p, _ := rocketmq.NewTransactionProducer( NewDemoListener(), - producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), producer.WithRetry(1), ) err := p.Start() diff --git a/producer/option.go b/producer/option.go index 76e9a31c..bacef7b1 100644 --- a/producer/option.go +++ b/producer/option.go @@ -122,8 +122,8 @@ func WithCreateTopicKey(topic string) Option { } } -// WithNsResovler set nameserver resolver to fetch nameserver addr -func WithNsResovler(resolver primitive.NsResolver) Option { +// WithNsResolver set nameserver resolver to fetch nameserver addr +func WithNsResolver(resolver primitive.NsResolver) Option { return func(options *producerOptions) { options.Resolver = resolver } diff --git a/producer/producer_test.go b/producer/producer_test.go index 508acf8a..d1b88c3f 100644 --- a/producer/producer_test.go +++ b/producer/producer_test.go @@ -35,7 +35,7 @@ const ( func TestShutdown(t *testing.T) { p, _ := NewDefaultProducer( - WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), WithRetry(2), WithQueueSelector(NewManualQueueSelector()), ) @@ -98,7 +98,7 @@ func mockB4Send(p *defaultProducer) { func TestSync(t *testing.T) { p, _ := NewDefaultProducer( - WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), WithRetry(2), WithQueueSelector(NewManualQueueSelector()), ) @@ -149,7 +149,7 @@ func TestSync(t *testing.T) { func TestASync(t *testing.T) { p, _ := NewDefaultProducer( - WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), WithRetry(2), WithQueueSelector(NewManualQueueSelector()), ) @@ -211,7 +211,7 @@ func TestASync(t *testing.T) { func TestOneway(t *testing.T) { p, _ := NewDefaultProducer( - WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), + WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})), WithRetry(2), WithQueueSelector(NewManualQueueSelector()), )