rename server options struct

This commit is contained in:
sentriz
2020-01-18 17:42:19 +00:00
parent 8e5d397082
commit fa12cb4150
2 changed files with 4 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ func main() {
log.Fatalf("error opening database: %v\n", err) log.Fatalf("error opening database: %v\n", err)
} }
defer db.Close() defer db.Close()
serverOptions := server.ServerOptions{ serverOptions := server.Options{
DB: db, DB: db,
MusicPath: *musicPath, MusicPath: *musicPath,
ListenAddr: *listenAddr, ListenAddr: *listenAddr,

View File

@@ -18,7 +18,7 @@ import (
"senan.xyz/g/gonic/server/ctrlsubsonic" "senan.xyz/g/gonic/server/ctrlsubsonic"
) )
type ServerOptions struct { type Options struct {
DB *db.DB DB *db.DB
MusicPath string MusicPath string
ListenAddr string ListenAddr string
@@ -29,10 +29,10 @@ type Server struct {
*http.Server *http.Server
router *mux.Router router *mux.Router
ctrlBase *ctrlbase.Controller ctrlBase *ctrlbase.Controller
opts ServerOptions opts Options
} }
func New(opts ServerOptions) *Server { func New(opts Options) *Server {
opts.MusicPath = filepath.Clean(opts.MusicPath) opts.MusicPath = filepath.Clean(opts.MusicPath)
ctrlBase := &ctrlbase.Controller{ ctrlBase := &ctrlbase.Controller{
DB: opts.DB, DB: opts.DB,