From 5f04287573dd0477f894c4493dc3cc5989fc8fb5 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 20 Jun 2018 11:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84gkafka=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/database/gkafka/gkafka.go | 6 +++--- geg/database/kafka/gkafka_consumer.go | 2 +- geg/database/kafka/gkafka_producer.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/g/database/gkafka/gkafka.go b/g/database/gkafka/gkafka.go index 4b18b49e5..24bc8ba52 100644 --- a/g/database/gkafka/gkafka.go +++ b/g/database/gkafka/gkafka.go @@ -1,10 +1,10 @@ -// Copyright 2017 gf Author(https://gitee.com/johng/gf). All Rights Reserved. +// Copyright 2018 gf Author(https://gitee.com/johng/gf). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// Kafka客户端. +// Kafka Client. package gkafka import ( @@ -42,7 +42,7 @@ type Message struct { // New a kafka client. -func New(config *Config) *Client { +func NewClient(config *Config) *Client { return &Client { Config : config, } diff --git a/geg/database/kafka/gkafka_consumer.go b/geg/database/kafka/gkafka_consumer.go index 9f702332d..a6fcd704e 100644 --- a/geg/database/kafka/gkafka_consumer.go +++ b/geg/database/kafka/gkafka_consumer.go @@ -12,7 +12,7 @@ func main () { config.Servers = "localhost:9092" config.Topics = "test" - client := gkafka.New(config) + client := gkafka.NewClient(config) defer client.Close() for { diff --git a/geg/database/kafka/gkafka_producer.go b/geg/database/kafka/gkafka_producer.go index 08ff3c304..218e226db 100644 --- a/geg/database/kafka/gkafka_producer.go +++ b/geg/database/kafka/gkafka_producer.go @@ -10,7 +10,7 @@ func main () { config.Servers = "localhost:9092" config.Topics = "test" - client := gkafka.New(config) + client := gkafka.NewClient(config) defer client.Close() err := client.SyncSend(&gkafka.Message{Value: []byte("1")}) fmt.Println(err)