Documentation ¶
Overview ¶
Package server implements the moggio protocol.
Index ¶
- Variables
- func Dir(useLocal bool, name string) http.FileSystem
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func Index(w http.ResponseWriter, r *http.Request)
- func JSON(h func(io.Reader, url.Values, httprouter.Params) (interface{}, error)) httprouter.Handle
- func ListenAndServe(stateFile, addr, central string, devMode bool) error
- type Playlist
- type PlaylistChange
- type PlaylistInfo
- type ProtocolData
- type Seek
- type Server
- func (srv *Server) Cmd(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) Data(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) GetMux(devMode bool) *http.ServeMux
- func (srv *Server) ListenAndServe(addr string, devMode bool) error
- func (srv *Server) OAuth(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (srv *Server) PlaylistChange(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) ProtocolAdd(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) ProtocolRefresh(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) ProtocolRemove(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) QueueChange(body io.Reader, form url.Values, ps httprouter.Params) (interface{}, error)
- func (srv *Server) TokenRegister(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (srv *Server) WebSocket(ws *websocket.Conn)
- type SongID
- type State
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var MoggioVersion string
Functions ¶
func Dir ¶ added in v0.0.7
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func FS ¶
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶ added in v0.0.5
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶ added in v0.0.5
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶ added in v0.0.5
FSMustString is the string version of FSMustByte.
func JSON ¶
func JSON(h func(io.Reader, url.Values, httprouter.Params) (interface{}, error)) httprouter.Handle
func ListenAndServe ¶
Types ¶
type PlaylistChange ¶ added in v0.0.7
type PlaylistChange [][]string
type PlaylistInfo ¶
type PlaylistInfo []listItem
type ProtocolData ¶ added in v0.0.7
type Seek ¶ added in v0.0.2
type Seek struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct { Queue Playlist Playlists map[string]Playlist Username string Token string Repeat bool Random bool Protocols map[string]map[string]protocol.Instance MinDuration time.Duration // Current song data. PlaylistIndex int // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
ListenAndServe listens on the TCP network address addr and then calls Serve to handle requests on incoming connections.
func (*Server) OAuth ¶
func (srv *Server) OAuth(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Server) PlaylistChange ¶
func (*Server) ProtocolAdd ¶
func (*Server) ProtocolRefresh ¶
func (*Server) ProtocolRemove ¶
func (*Server) QueueChange ¶
func (*Server) TokenRegister ¶ added in v0.1.0
func (srv *Server) TokenRegister(w http.ResponseWriter, r *http.Request, p httprouter.Params)
type SongID ¶
func (SongID) MarshalJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.