Documentation ¶
Overview ¶
Package groupcache is an fs.FS wrapper for caching purposes built around Brad Fitzpatrick's groupcache.
This package behaves slightly different than our other cache packages due to its unique characteristics such as key groupings and automatic cache filling. These features which make groupcache great are slightly annoying in this context (nothing is perfect for everything).
Index ¶
- type FS
- func (f *FS) NewGroup(name string, sizeInBytes int64) error
- func (f *FS) Open(name string) (fs.File, error)
- func (f *FS) OpenFile(name string, perms fs.FileMode, options ...jsfs.OFOption) (fs.File, error)
- func (f *FS) ReadFile(name string) ([]byte, error)
- func (f *FS) SetFiller(fsys cache.CacheFS)
- func (f *FS) Stat(name string) (fs.FileInfo, error)
- func (f *FS) WriteFile(name string, content []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS represents a fs.FS that implements OpenFile() and allows reading and writing to a groupcache.
func (*FS) NewGroup ¶
NewGroup creates a new groupcache group which acts like a top level directory. sizeInBytes is the maximum size in bytes that the group can hold. Trying to open a file in a path without a group that is recognized will fail.
func (*FS) OpenFile ¶
OpenFile implements fs.OpenFiler.OpenFile(). When writing a file, the file is not written until Close() is called on the file. Perms are ignored by OpenFile.
func (*FS) Stat ¶
Stat implements fs.StatFS.Stat(). The FileInfo returned name and size can be used, but the others are static values. ModTime will always be the zero value. It should be noted that this is simple a bad wrapper on Open(), so the content is read as I did not see a way to query Redis for just the key size (and to be honest, I didn't dig to hard).
Directories ¶
Path | Synopsis |
---|---|
Package peerpicker provides a groupcache.PeerPicker that utilizes a LAN peer discovery mechanism and sets up the groupcache to use the HTTPPool for communication between nodes.
|
Package peerpicker provides a groupcache.PeerPicker that utilizes a LAN peer discovery mechanism and sets up the groupcache to use the HTTPPool for communication between nodes. |
app
So....
|
So.... |