Skip to content

Commit

Permalink
use iota for go-client (apache#3474)
Browse files Browse the repository at this point in the history
### Motivation

use iota to replace the original way

Signed-off-by: xiaolong.ran <[email protected]>
  • Loading branch information
wolfstudy authored and sijie committed Jan 30, 2019
1 parent cc3eb7f commit a1826af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pulsar-client-go/pulsar/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ type SubscriptionType int

const (
// There can be only 1 consumer on the same topic with the same subscription name
Exclusive SubscriptionType = 0
Exclusive SubscriptionType = iota

// Multiple consumer will be able to use the same subscription name and the messages will be dispatched according to
// a round-robin rotation between the connected consumers
Shared SubscriptionType = 1
Shared

// Multiple consumer will be able to use the same subscription name but only 1 consumer will receive the messages.
// If that consumer disconnects, one of the other connected consumers will start receiving messages.
Failover SubscriptionType = 2
Failover
)

// ConsumerBuilder is used to configure and create instances of Consumer
Expand Down
20 changes: 10 additions & 10 deletions pulsar-client-go/pulsar/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@ type MessageRoutingMode int

const (
// Publish messages across all partitions in round-robin.
RoundRobinDistribution MessageRoutingMode = 0
RoundRobinDistribution MessageRoutingMode = iota

// The producer will chose one single partition and publish all the messages into that partition
UseSinglePartition MessageRoutingMode = 1
UseSinglePartition

// Use custom message router implementation that will be called to determine the partition for a particular message.
CustomPartition MessageRoutingMode = 2
CustomPartition
)

type HashingScheme int

const (
JavaStringHash HashingScheme = 0 // Java String.hashCode() equivalent
Murmur3_32Hash HashingScheme = 1 // Use Murmur3 hashing function
BoostHash HashingScheme = 2 // C++ based boost::hash
JavaStringHash HashingScheme = iota // Java String.hashCode() equivalent
Murmur3_32Hash // Use Murmur3 hashing function
BoostHash // C++ based boost::hash
)

type CompressionType int

const (
NoCompression CompressionType = 0
LZ4 CompressionType = 1
ZLib CompressionType = 2
ZSTD CompressionType = 3
NoCompression CompressionType = iota
LZ4
ZLib
ZSTD
)

type TopicMetadata interface {
Expand Down

0 comments on commit a1826af

Please sign in to comment.