navidrome/controllers/ping.go

19 lines
381 B
Go
Raw Normal View History

2016-02-24 00:07:57 -05:00
package controllers
2016-02-24 00:29:27 -05:00
import (
"github.com/astaxie/beego"
"encoding/xml"
"github.com/deluan/gosonic/controllers/responses"
2016-02-24 00:29:27 -05:00
)
2016-02-24 00:07:57 -05:00
2016-02-24 00:29:27 -05:00
type PingController struct{ beego.Controller }
2016-02-24 00:07:57 -05:00
// @router /rest/ping.view [get]
func (this *PingController) Get() {
2016-02-24 12:00:55 -05:00
response := responses.NewEmpty()
2016-02-24 00:29:27 -05:00
xmlBody, _ := xml.Marshal(response)
this.Ctx.Output.Body([]byte(xml.Header + string(xmlBody)))
2016-02-24 00:07:57 -05:00
}