shiori/internal/webserver/server.go
Yuta Hayashibe c64e858a23
Fix typos (#756)
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2023-10-22 17:43:49 +02:00

32 lines
784 B
Go

package webserver
import (
"time"
"github.com/go-shiori/shiori/internal/config"
"github.com/go-shiori/shiori/internal/database"
cch "github.com/patrickmn/go-cache"
)
// Config is parameter that used for starting web server
type Config struct {
DB database.DB
DataDir string
ServerAddress string
ServerPort int
RootPath string
Log bool
}
func GetLegacyHandler(cfg Config, dependencies *config.Dependencies) *Handler {
return &Handler{
DB: cfg.DB,
DataDir: cfg.DataDir,
UserCache: cch.New(time.Hour, 10*time.Minute),
SessionCache: cch.New(time.Hour, 10*time.Minute),
ArchiveCache: cch.New(time.Minute, 5*time.Minute),
RootPath: cfg.RootPath,
Log: cfg.Log,
dependencies: dependencies,
}
}