Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultServerPort is the default port for the server
DefaultServerPort = 6379
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // Cache is the actual cache Cache *gocache.Cache // Port is the port that the server will listen on Port int // AutoSaveInterval is the interval at which the server will automatically save the Cache AutoSaveInterval time.Duration // AutoSaveFile is the file in which the cache will be persisted every AutoSaveInterval AutoSaveFile string // contains filtered or unexported fields }
Server is a cache server using gocache as cache and RESP (Redis bindings) as server
func (*Server) Start ¶
Start starts the cache server, which includes the autosave
This is a blocking function, therefore, you are expected to run this on a goroutine
func (*Server) WithAutoSave ¶
WithAutoSave allows the configuration of the automatic saving feature. Note that setting this will also cause the server to immediately read the file passed and populate the cache
Disabled if set to 0
Click to show internal directories.
Click to hide internal directories.