Documentation
¶
Index ¶
- Constants
- type Content
- func (me *Content) Browse(id ObjID, mode string, start, wanted uint32) (result string, returned, total uint32, err error)
- func (me *Content) ContainerUpdateIDs() (updates string)
- func (me *Content) Errors() <-chan error
- func (me *Content) InitialUpdate(ctx context.Context) (err error)
- func (me *Content) Picture(id uint64) *[]byte
- func (me *Content) ResetCtrUpdCounts()
- func (me *Content) Run(ctx context.Context, wg *sync.WaitGroup)
- func (me *Content) UpdateNotification() <-chan UpdateNotification
- func (me *Content) WriteStatus(w io.Writer)
- type ObjID
- type UpdateNotification
Constants ¶
const ( ModeMetadata = "BrowseMetadata" ModeChildren = "BrowseDirectChildren" )
values of the BrowseFlag attribute of the ContentDirectory service
const ( MusicFolder = "/music/" PictureFolder = "/pictures/" )
root folder for music and picture requests note: they must end with a slash!
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct {
// contains filtered or unexported fields
}
Content contains the different muserv content objects, such as tracks, albums, hierarchies and methods to management them
func (*Content) Browse ¶
func (me *Content) Browse(id ObjID, mode string, start, wanted uint32) (result string, returned, total uint32, err error)
Browse implements the Browse SOAP action of the ContentDirectory service
func (*Content) ContainerUpdateIDs ¶
ContainerUpdateIDs assembles the new value for the state variable ContainerUpdateIDs
func (*Content) InitialUpdate ¶
InitialUpdate executes a one-time content update after muserv has been started
func (*Content) Picture ¶
Picture returns the picture with the given ID. If it doesn't exist, nil is returned
func (*Content) ResetCtrUpdCounts ¶
func (me *Content) ResetCtrUpdCounts()
ResetCtrUpdCounts resets the ContainerUpdateIDValues for all container objects
func (*Content) UpdateNotification ¶
func (me *Content) UpdateNotification() <-chan UpdateNotification
UpdateNotification returns a receive-only channel to notify about updates
func (*Content) WriteStatus ¶
WriteStatus writes the content status to w
type ObjID ¶
type ObjID int64
ObjID is the unique identified of an object
func ObjIDFromString ¶
ObjIDFromString create an object ID from a string
type UpdateNotification ¶
type UpdateNotification struct { // Update triggers update Update func() // Updated provides the info update was done and how many objects were // changed, deleted or added Updated chan uint32 }
UpdateNotification is used to inform the caller about updates. It contains a function to execute the update and a channel to inform the caller that the update was done