rename server options struct
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user