示例#1
0
文件: server.go 项目: ngaut/libredis
// SentinelInfo returns information and statistics for a sentinel instance
// In RedisInfoAll struct see the github.com/therealbill/libredis/info package
// for details
func (r *Redis) SentinelInfo() (sinfo info.RedisInfoAll, err error) {
	rp, err := r.ExecuteCommand("info")
	if err != nil {
		return
	}
	strval, _ := rp.StringValue()
	if err != nil {
		return
	}
	sinfo = info.GetAllInfo(strval)
	return
}
示例#2
0
// Info returns information and statistics about the server
// In RedisInfoAll struct see the github.com/therealbill/libredis/info package
// for details
func (r *Redis) Info() (sinfo structures.RedisInfoAll, err error) {
	rp, err := r.ExecuteCommand("info", "all")
	if err != nil {
		return
	}
	strval, _ := rp.StringValue()
	if err != nil {
		return
	}
	sinfo = info.GetAllInfo(strval)
	return
}