Files
pmomusic/cmd/pmomusic/main.go

37 lines
705 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package main
import (
"context"
"os/signal"
"syscall"
"time"
log "github.com/sirupsen/logrus"
"gargoton.petite-maison-orange.fr/eric/pmomusic/pmoupnp"
"gargoton.petite-maison-orange.fr/eric/pmomusic/pmoupnp/devices/mediarenderer"
)
func main() {
log.SetLevel(log.DebugLevel) // → niveau debug
ctx, stop := signal.NotifyContext(
context.Background(),
syscall.SIGINT,
syscall.SIGTERM,
)
defer stop()
// Crée le serveur avec baseURL auto-déduite depuis lIP locale
server := pmoupnp.NewServer("pmomusic")
server.RegisterDevice("", mediarenderer.FakeRenderer)
if err := server.Run(ctx); err != nil {
log.Fatalf("server error: %v", err)
}
time.Sleep(2 * time.Second)
}