Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvgef committed Jul 8, 2020
1 parent 81309f0 commit f665f53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ type Value struct {
*redis.StringCmd
}

// 设置一个键值,如果键名存在则覆盖
func (obj *Session) Set(key string, value interface{}) error {
return redisClient.HSet(obj.ID, key, value).Err()
}

// Get 读取参数值
func (obj *Session) Get(key string) *Value {
var result Value
Expand All @@ -43,6 +38,11 @@ func (obj *Session) Get(key string) *Value {
return &result
}

// 设置一个键值,如果键名存在则覆盖
func (obj *Session) Set(key string, value interface{}) error {
return redisClient.HSet(obj.ID, key, value).Err()
}

// String 将值转为string类型
func (v *Value) String() (string, error) {
if v.Error != nil {
Expand Down

0 comments on commit f665f53

Please sign in to comment.