mirror of
https://github.com/go-shiori/shiori.git
synced 2025-10-06 03:35:35 +08:00
* migrate bookmark content route to new http server * new archive page * remove unused go generate comment * database mock * utils cleanup * unused var * domains refactor and tests * fixed secret key type * redirect to login on ui errors * fixed archive folder with storage domain * webroot documentation * some bookmark route tests * fixed error in bookmark domain for non existant bookmarks * centralice errors * add coverage data to unittests * added tests, refactor storage to use afero * removed mock to avoid increasing complexity * using deps to copy files around * remove config usage (to deps) * remove handler-ui file
32 lines
796 B
Go
32 lines
796 B
Go
package webserver
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-shiori/shiori/internal/database"
|
|
"github.com/go-shiori/shiori/internal/dependencies"
|
|
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 *dependencies.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,
|
|
}
|
|
}
|