forked from mirror/redis
parent
1b1fc80e20
commit
9ccc23344a
34
result.go
34
result.go
|
@ -2,7 +2,7 @@ package redis
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
// NewCmdResult returns a Cmd initalised with val and err for testing
|
// NewCmdResult returns a Cmd initialised with val and err for testing
|
||||||
func NewCmdResult(val interface{}, err error) *Cmd {
|
func NewCmdResult(val interface{}, err error) *Cmd {
|
||||||
var cmd Cmd
|
var cmd Cmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -10,7 +10,7 @@ func NewCmdResult(val interface{}, err error) *Cmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSliceResult returns a SliceCmd initalised with val and err for testing
|
// NewSliceResult returns a SliceCmd initialised with val and err for testing
|
||||||
func NewSliceResult(val []interface{}, err error) *SliceCmd {
|
func NewSliceResult(val []interface{}, err error) *SliceCmd {
|
||||||
var cmd SliceCmd
|
var cmd SliceCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -18,7 +18,7 @@ func NewSliceResult(val []interface{}, err error) *SliceCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStatusResult returns a StatusCmd initalised with val and err for testing
|
// NewStatusResult returns a StatusCmd initialised with val and err for testing
|
||||||
func NewStatusResult(val string, err error) *StatusCmd {
|
func NewStatusResult(val string, err error) *StatusCmd {
|
||||||
var cmd StatusCmd
|
var cmd StatusCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -26,7 +26,7 @@ func NewStatusResult(val string, err error) *StatusCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewIntResult returns an IntCmd initalised with val and err for testing
|
// NewIntResult returns an IntCmd initialised with val and err for testing
|
||||||
func NewIntResult(val int64, err error) *IntCmd {
|
func NewIntResult(val int64, err error) *IntCmd {
|
||||||
var cmd IntCmd
|
var cmd IntCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -34,7 +34,7 @@ func NewIntResult(val int64, err error) *IntCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDurationResult returns a DurationCmd initalised with val and err for testing
|
// NewDurationResult returns a DurationCmd initialised with val and err for testing
|
||||||
func NewDurationResult(val time.Duration, err error) *DurationCmd {
|
func NewDurationResult(val time.Duration, err error) *DurationCmd {
|
||||||
var cmd DurationCmd
|
var cmd DurationCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -42,7 +42,7 @@ func NewDurationResult(val time.Duration, err error) *DurationCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBoolResult returns a BoolCmd initalised with val and err for testing
|
// NewBoolResult returns a BoolCmd initialised with val and err for testing
|
||||||
func NewBoolResult(val bool, err error) *BoolCmd {
|
func NewBoolResult(val bool, err error) *BoolCmd {
|
||||||
var cmd BoolCmd
|
var cmd BoolCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -50,7 +50,7 @@ func NewBoolResult(val bool, err error) *BoolCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStringResult returns a StringCmd initalised with val and err for testing
|
// NewStringResult returns a StringCmd initialised with val and err for testing
|
||||||
func NewStringResult(val string, err error) *StringCmd {
|
func NewStringResult(val string, err error) *StringCmd {
|
||||||
var cmd StringCmd
|
var cmd StringCmd
|
||||||
cmd.val = []byte(val)
|
cmd.val = []byte(val)
|
||||||
|
@ -58,7 +58,7 @@ func NewStringResult(val string, err error) *StringCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFloatResult returns a FloatCmd initalised with val and err for testing
|
// NewFloatResult returns a FloatCmd initialised with val and err for testing
|
||||||
func NewFloatResult(val float64, err error) *FloatCmd {
|
func NewFloatResult(val float64, err error) *FloatCmd {
|
||||||
var cmd FloatCmd
|
var cmd FloatCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -66,7 +66,7 @@ func NewFloatResult(val float64, err error) *FloatCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStringSliceResult returns a StringSliceCmd initalised with val and err for testing
|
// NewStringSliceResult returns a StringSliceCmd initialised with val and err for testing
|
||||||
func NewStringSliceResult(val []string, err error) *StringSliceCmd {
|
func NewStringSliceResult(val []string, err error) *StringSliceCmd {
|
||||||
var cmd StringSliceCmd
|
var cmd StringSliceCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -74,7 +74,7 @@ func NewStringSliceResult(val []string, err error) *StringSliceCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBoolSliceResult returns a BoolSliceCmd initalised with val and err for testing
|
// NewBoolSliceResult returns a BoolSliceCmd initialised with val and err for testing
|
||||||
func NewBoolSliceResult(val []bool, err error) *BoolSliceCmd {
|
func NewBoolSliceResult(val []bool, err error) *BoolSliceCmd {
|
||||||
var cmd BoolSliceCmd
|
var cmd BoolSliceCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -82,7 +82,7 @@ func NewBoolSliceResult(val []bool, err error) *BoolSliceCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStringStringMapResult returns a StringStringMapCmd initalised with val and err for testing
|
// NewStringStringMapResult returns a StringStringMapCmd initialised with val and err for testing
|
||||||
func NewStringStringMapResult(val map[string]string, err error) *StringStringMapCmd {
|
func NewStringStringMapResult(val map[string]string, err error) *StringStringMapCmd {
|
||||||
var cmd StringStringMapCmd
|
var cmd StringStringMapCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -90,7 +90,7 @@ func NewStringStringMapResult(val map[string]string, err error) *StringStringMap
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStringIntMapCmdResult returns a StringIntMapCmd initalised with val and err for testing
|
// NewStringIntMapCmdResult returns a StringIntMapCmd initialised with val and err for testing
|
||||||
func NewStringIntMapCmdResult(val map[string]int64, err error) *StringIntMapCmd {
|
func NewStringIntMapCmdResult(val map[string]int64, err error) *StringIntMapCmd {
|
||||||
var cmd StringIntMapCmd
|
var cmd StringIntMapCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -98,7 +98,7 @@ func NewStringIntMapCmdResult(val map[string]int64, err error) *StringIntMapCmd
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewZSliceCmdResult returns a ZSliceCmd initalised with val and err for testing
|
// NewZSliceCmdResult returns a ZSliceCmd initialised with val and err for testing
|
||||||
func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
|
func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
|
||||||
var cmd ZSliceCmd
|
var cmd ZSliceCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -106,7 +106,7 @@ func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewScanCmdResult returns a ScanCmd initalised with val and err for testing
|
// NewScanCmdResult returns a ScanCmd initialised with val and err for testing
|
||||||
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
|
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
|
||||||
var cmd ScanCmd
|
var cmd ScanCmd
|
||||||
cmd.page = keys
|
cmd.page = keys
|
||||||
|
@ -115,7 +115,7 @@ func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClusterSlotsCmdResult returns a ClusterSlotsCmd initalised with val and err for testing
|
// NewClusterSlotsCmdResult returns a ClusterSlotsCmd initialised with val and err for testing
|
||||||
func NewClusterSlotsCmdResult(val []ClusterSlot, err error) *ClusterSlotsCmd {
|
func NewClusterSlotsCmdResult(val []ClusterSlot, err error) *ClusterSlotsCmd {
|
||||||
var cmd ClusterSlotsCmd
|
var cmd ClusterSlotsCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
@ -123,7 +123,7 @@ func NewClusterSlotsCmdResult(val []ClusterSlot, err error) *ClusterSlotsCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGeoLocationCmdResult returns a GeoLocationCmd initalised with val and err for testing
|
// NewGeoLocationCmdResult returns a GeoLocationCmd initialised with val and err for testing
|
||||||
func NewGeoLocationCmdResult(val []GeoLocation, err error) *GeoLocationCmd {
|
func NewGeoLocationCmdResult(val []GeoLocation, err error) *GeoLocationCmd {
|
||||||
var cmd GeoLocationCmd
|
var cmd GeoLocationCmd
|
||||||
cmd.locations = val
|
cmd.locations = val
|
||||||
|
@ -131,7 +131,7 @@ func NewGeoLocationCmdResult(val []GeoLocation, err error) *GeoLocationCmd {
|
||||||
return &cmd
|
return &cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCommandsInfoCmdResult returns a CommandsInfoCmd initalised with val and err for testing
|
// NewCommandsInfoCmdResult returns a CommandsInfoCmd initialised with val and err for testing
|
||||||
func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsInfoCmd {
|
func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsInfoCmd {
|
||||||
var cmd CommandsInfoCmd
|
var cmd CommandsInfoCmd
|
||||||
cmd.val = val
|
cmd.val = val
|
||||||
|
|
Loading…
Reference in New Issue