-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add server to get redis cluster info (#128)
* fix: changes to make telepresence work * fix: change k8s version * feat: add server and router, without module * feat: add server to get cluster info * fix according to review comments Co-authored-by: Dina Yakovlev <dina.yakovlev@zooz.com>
- Loading branch information
1 parent
117b6fe
commit a1a57c9
Showing
15 changed files
with
229 additions
and
4 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
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
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,32 @@ | ||
package data | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
) | ||
|
||
func SaveRedisClusterView(data []byte) { | ||
fileName := os.Getenv("CLUSTER_VIEW_FILE") | ||
|
||
_ = ioutil.WriteFile(fileName, data, 0644) | ||
} | ||
|
||
func GetClusterView() ([]byte, error) { | ||
fileName := os.Getenv("CLUSTER_VIEW_FILE") | ||
|
||
return ioutil.ReadFile(fileName) | ||
} | ||
|
||
func SaveRedisClusterState(s string) { | ||
fileName := os.Getenv("CLUSTER_STATE_FILE") | ||
_ = ioutil.WriteFile(fileName, []byte(s), 0644) | ||
} | ||
|
||
func GetRedisClusterState() string { | ||
fileName := os.Getenv("CLUSTER_STATE_FILE") | ||
byteValue, err := ioutil.ReadFile(fileName) | ||
if err != nil { | ||
return "NotExists" | ||
} | ||
return string(byteValue) | ||
} |
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
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
Oops, something went wrong.