코드 정리 및 websocket도 http와 비슷하게 api handler로 통일
This commit is contained in:
11
redis.go
11
redis.go
@ -195,6 +195,17 @@ func (rh *RedisonHandler) JSONGetString(key, path string) ([]string, error) {
|
||||
return respToArray[string](rh.JSONResp(key, path))
|
||||
}
|
||||
|
||||
func (rh *RedisonHandler) JSONGetDocuments(key, path string) ([]map[string]any, error) {
|
||||
resp, err := rh.JSONGet(key, path)
|
||||
if err != nil && err != redis.Nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var objs []map[string]any
|
||||
err = json.Unmarshal([]byte(resp.(string)), &objs)
|
||||
return objs, err
|
||||
}
|
||||
|
||||
func (rh *RedisonHandler) JSONGetInt64(key, path string) ([]int64, error) {
|
||||
return respToArray[int64](rh.JSONResp(key, path))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user