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)