代码拉取完成,页面将自动刷新
package storage
import "time"
// StorageType 缓存实例类型
// - 0 => 未知或无效的驱动库
// - 1 => MemoryCache 缓存实例
// - 2 => RedisCache 缓存实例
// - 3 => L2Cache Local+Remote 二级缓存实例, 通常为 MemoryCache + RedisCache 驱动组合模式
type StorageType uint8
const (
StorageInvalid StorageType = iota // 0 => 未知或无效的缓存实例
StorageMemory // 1 => MemoryCache 缓存实例
StorageRedis // 2 => RedisCache 缓存实例
StorageL2Cache // 3 => L2Cache Local+Remote 二级缓存实例, 通常为 MemoryCache + RedisCache 驱动组合模式
)
func (t StorageType) String() string {
switch t {
case StorageMemory:
return "Storage Memory"
case StorageRedis:
return "Storage Redis"
case StorageL2Cache:
return "Storage L2Cache"
default:
return "Storage Invalid"
}
}
// LiveState 缓存实例的运行状态枚举值
// - 0 => 关闭状态
// - 1 => 正常状态
// - 2 => 异常状态
type LiveState int8
const (
LiveStateShutdown LiveState = iota // 0 关闭状态
LiveStateNormal // 1 正常状态
LiveStateFailure // 2 异常状态
)
type TypeBase interface {
string | bool | TypeNumber | TypeTime
}
type TypeBaseSlice interface {
[]string | []bool |
[]int | []int8 | []int16 | []int32 | []int64 |
[]uint | []uint8 | []uint16 | []uint32 | []uint64 |
[]float32 | []float64 |
[]time.Time | []time.Duration | []time.Month | []time.Weekday
}
type TypeNumber interface {
TypeInt | TypeUint | TypeFloat
}
type TypeInt interface {
int | int8 | int16 | int32 | int64 // rune => int32
}
type TypeUint interface {
uint | uint8 | uint16 | uint32 | uint64 // byte => uint8 uintptr => uint32/uint64
}
type TypeFloat interface {
float32 | float64
}
type TypeTime interface {
time.Time | time.Duration | time.Month | time.Weekday
}
type TypeSliceAny []any
type TypeSliceBase[T TypeBase] []T
type TypeMapBaseAny[K TypeBase] map[K]any
type TypeMapComparableAny[K comparable] map[K]any
type TypeMapBaseAs[K TypeBase, V TypeBase] map[K]V
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。