-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved Watch Manager and Store API compatibility (#1046)
- Loading branch information
1 parent
b0c9fe5
commit b577b4e
Showing
6 changed files
with
77 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package store | ||
|
||
const ( | ||
Set string = "set" | ||
Del string = "del" | ||
Set string = "SET" | ||
Del string = "DEL" | ||
Get string = "GET" | ||
Rename string = "RENAME" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package store | ||
|
||
type PutOptions struct { | ||
KeepTTL bool | ||
PutCmd string | ||
} | ||
|
||
func getDefaultPutOptions() *PutOptions { | ||
return &PutOptions{ | ||
KeepTTL: false, | ||
PutCmd: Set, | ||
} | ||
} | ||
|
||
type PutOption func(*PutOptions) | ||
|
||
func WithKeepTTL(value bool) PutOption { | ||
return func(po *PutOptions) { | ||
po.KeepTTL = value | ||
} | ||
} | ||
|
||
func WithPutCmd(cmd string) PutOption { | ||
return func(po *PutOptions) { | ||
po.PutCmd = cmd | ||
} | ||
} | ||
|
||
type DelOptions struct { | ||
DelCmd string | ||
} | ||
|
||
func getDefaultDelOptions() *DelOptions { | ||
return &DelOptions{ | ||
DelCmd: Del, | ||
} | ||
} | ||
|
||
type DelOption func(*DelOptions) | ||
|
||
func WithDelCmd(cmd string) DelOption { | ||
return func(po *DelOptions) { | ||
po.DelCmd = cmd | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters