Exposing expiration for memory driver

This commit is contained in:
Frederick F. Kautz IV
2015-04-30 21:15:33 -07:00
parent c01fb92eca
commit b86b26e7e5
4 changed files with 20 additions and 8 deletions

View File

@@ -34,13 +34,14 @@ import (
// MemoryFactory is used to build memory api servers
type MemoryFactory struct {
httpserver.Config
MaxMemory uint64
MaxMemory uint64
Expiration time.Duration
}
// GetStartServerFunc builds memory api servers
func (f MemoryFactory) GetStartServerFunc() StartServerFunc {
return func() (chan<- string, <-chan error) {
_, _, driver := memory.Start(f.MaxMemory, 1*time.Hour)
_, _, driver := memory.Start(f.MaxMemory, f.Expiration)
//ctrl, status, _ := httpserver.Start(api.HTTPHandler(f.Domain, driver), f.Config)
ctrl, status, _ := httpserver.Start(api.HTTPHandler("", driver), f.Config)
return ctrl, status