Skip to content

Commit

Permalink
Moving constant to client.go and making it private
Browse files Browse the repository at this point in the history
  • Loading branch information
slaunay committed Jun 1, 2016
1 parent eb91506 commit 666bedf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ type Client interface {
}

const (
// Default ClientID
DefaultClientID = "sarama"
// OffsetNewest stands for the log head offset, i.e. the offset that will be
// assigned to the next message that will be produced to the partition. You
// can send this to a client's GetOffset method to get this offset, or when
Expand Down
6 changes: 4 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"time"
)

const defaultClientID = "sarama"

var validID *regexp.Regexp = regexp.MustCompile(`\A[A-Za-z0-9._-]+\z`)

// Config is used to pass multiple configuration options to Sarama's constructors.
Expand Down Expand Up @@ -258,7 +260,7 @@ func NewConfig() *Config {

c.ChannelBufferSize = 256

c.ClientID = DefaultClientID
c.ClientID = defaultClientID

return c
}
Expand Down Expand Up @@ -299,7 +301,7 @@ func (c *Config) Validate() error {
if c.Consumer.Offsets.Retention%time.Millisecond != 0 {
Logger.Println("Consumer.Offsets.Retention only supports millisecond precision; nanoseconds will be truncated.")
}
if c.ClientID == DefaultClientID {
if c.ClientID == defaultClientID {
Logger.Println("ClientID is the default of 'sarama', you should consider setting it to something application-specific.")
}

Expand Down

0 comments on commit 666bedf

Please sign in to comment.