Use ID over Id from Golang best practices
This commit is contained in:
parent
57dc74bd48
commit
f7d1202fe0
1 changed files with 7 additions and 7 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
type Checkpoint interface {
|
||||
CheckpointExists(streamName string, shardID string) bool
|
||||
SequenceNumber() string
|
||||
SetCheckpoint(streamName string, shardId string, sequenceNumber string)
|
||||
SetCheckpoint(streamName string, shardID string, sequenceNumber string)
|
||||
}
|
||||
|
||||
type RedisCheckpoint struct {
|
||||
|
|
@ -22,8 +22,8 @@ func (c RedisCheckpoint) SequenceNumber() string {
|
|||
return c.sequenceNumber
|
||||
}
|
||||
|
||||
func (c *RedisCheckpoint) CheckpointExists(streamName string, shardId string) bool {
|
||||
key := c.keyGen(streamName, shardId)
|
||||
func (c *RedisCheckpoint) CheckpointExists(streamName string, shardID string) bool {
|
||||
key := c.keyGen(streamName, shardID)
|
||||
val, _ := c.client.Get(key)
|
||||
|
||||
if val != nil {
|
||||
|
|
@ -34,12 +34,12 @@ func (c *RedisCheckpoint) CheckpointExists(streamName string, shardId string) bo
|
|||
}
|
||||
}
|
||||
|
||||
func (c *RedisCheckpoint) SetCheckpoint(streamName string, shardId string, sequenceNumber string) {
|
||||
key := c.keyGen(streamName, shardId)
|
||||
func (c *RedisCheckpoint) SetCheckpoint(streamName string, shardID string, sequenceNumber string) {
|
||||
key := c.keyGen(streamName, shardID)
|
||||
c.client.Set(key, []byte(sequenceNumber))
|
||||
c.sequenceNumber = sequenceNumber
|
||||
}
|
||||
|
||||
func (c RedisCheckpoint) keyGen(streamName string, shardId string) string {
|
||||
return fmt.Sprintf("%v:checkpoint:%v:%v", c.appName, streamName, shardId)
|
||||
func (c RedisCheckpoint) keyGen(streamName string, shardID string) string {
|
||||
return fmt.Sprintf("%v:checkpoint:%v:%v", c.appName, streamName, shardID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue