Files
mayfly-go/server/internal/redis/api/form/redis.go

88 lines
2.0 KiB
Go
Raw Normal View History

package form
type Redis struct {
2023-06-11 19:59:35 +08:00
Id uint64 `json:"id"`
2022-10-26 20:49:29 +08:00
Name string `json:"name"`
2023-06-11 19:59:35 +08:00
Host string `json:"host" binding:"required"`
Username string `json:"username"`
Password string `json:"password"`
Mode string `json:"mode"`
2022-09-29 13:14:50 +08:00
Db string `json:"db"`
SshTunnelMachineId int `json:"sshTunnelMachineId"` // ssh隧道机器id
2022-10-26 20:49:29 +08:00
TagId uint64 `binding:"required" json:"tagId"`
TagPath string `binding:"required" json:"tagPath"`
Remark string `json:"remark"`
}
type Rename struct {
Key string `binding:"required" json:"key"`
NewKey string `binding:"required" json:"newKey"`
}
type Expire struct {
Key string `binding:"required" json:"key"`
Seconds int64 `binding:"required" json:"seconds"`
}
type KeyInfo struct {
Key string `binding:"required" json:"key"`
2023-06-11 19:59:35 +08:00
Timed int64 `json:"timed"`
}
type StringValue struct {
KeyInfo
Value any `binding:"required" json:"value"`
}
type HashValue struct {
KeyInfo
Value []map[string]any `binding:"required" json:"value"`
}
type SetValue struct {
KeyInfo
Value []any `binding:"required" json:"value"`
}
type ListValue struct {
KeyInfo
Value []any `binding:"required" json:"value"`
}
// list lset命令参数入参
type ListSetValue struct {
Key string `binding:"required" json:"key"`
2023-06-11 19:59:35 +08:00
Index int64 `json:"index"`
Value any `binding:"required" json:"value"`
}
type RedisScanForm struct {
Cursor map[string]uint64 `json:"cursor"`
Match string `json:"match"`
Count int64 `json:"count"`
}
type ScanForm struct {
Key string `json:"key"`
Cursor uint64 `json:"cursor"`
Match string `json:"match"`
Count int64 `json:"count"`
}
type SmemberOption struct {
Key string `json:"key"`
Member any `json:"member"`
}
type LRemOption struct {
Key string `json:"key"`
Count int64 `json:"count"`
Member any `json:"member"`
}
type ZAddOption struct {
Key string `json:"key"`
Score float64 `json:"score"`
Member any `json:"member"`
}