Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteView ¶
type ByteView struct {
// contains filtered or unexported fields
}
A ByteView holds an immutable view of bytes.
func (ByteView) ByteSlice ¶
ByteSlice returns a copy of the data as a byte slice. b 是只读的,使用 ByteSlice() 方法返回一个拷贝,防止缓存值被外部程序修改
type GetterFunc ¶
A GetterFunc implements Getter with a function. 定义函数类型 GetterFunc,并实现 Getter 接口的 Get 方法 函数类型实现某一个接口,称之为接口型函数,方便使用者在调用时既能够传入函数作为参数,也能够传入实现了该接口的结构体作为参数
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
A Group is a cache namespace and associated data loaded spread over 一个 Group 可以认为是一个缓存的命名空间
func GetGroup ¶
GetGroup returns the named group previously created with NewGroup, or nil if there's no such group. GetGroup 用来特定名称的 Group,这里使用了只读锁 RLock(),因为不涉及任何冲突变量的写操作
Click to show internal directories.
Click to hide internal directories.