didl_lite

package
v0.0.0-...-bf4a537 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagContributor          = "dc:contributor"
	TagCreator              = "dc:creator"
	TagDate                 = "dc:date"
	TagDescription          = "dc:description"
	TagLanguage             = "dc:language"
	TagPublisher            = "dc:publisher"
	TagRelation             = "dc:relation"
	TagRights               = "dc:rights"
	TagArtist               = "upnp:artist"
	TagActor                = "upnp:actor"
	TagAuthor               = "upnp:author"
	TagProducer             = "upnp:producer"
	TagDirector             = "upnp:director"
	TagGenre                = "upnp:genre"
	TagAlbum                = "upnp:album"
	TagAlbumArtURI          = "upnp:albumArtURI"
	TagArtistDiscographyURI = "upnp:artistDiscographyURI"
	TagLyricsURI            = "upnp:lyricsURI"
	TagLongDescription      = "upnp:longDescription"
	TagIcon                 = "upnp:icon"
	TagRegion               = "upnp:region"
	TagOriginalTrackNumber  = "upnp:originalTrackNumber"
	TagTOC                  = "upnp:toc"
	TagContainerUpdateID    = "upnp:containerUpdateID"
	TagObjectUpdateID       = "upnp:objectUpdateID"
)
View Source
const (
	ResDuration        = "duration"
	ResSize            = "size"
	ResBitrate         = "bitrate"
	ResSampleFrequency = "sampleFrequency"
	ResBitsPerSample   = "bitsPerSample"
	ResNrAudioChannels = "nrAudioChannels"
	ResResolution      = "resolution"
	ResColorDepth      = "colorDepth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common struct {
	ID         string `xml:"id,attr"`
	ParentID   string `xml:"parentID,attr"`
	Restricted bool   `xml:"restricted,attr"`

	// Mandatory elements
	Title string `xml:"dc:title" json:"dc:title"`
	Class string `xml:"upnp:class" json:"upnp:class"`

	// Optional elements
	Tags tagElements

	// Related resources
	Resources []Resource `xml:"res" json:",omitempty"`
}

Common holds the properties shared by Items and Containers

func (*Common) AddResources

func (c *Common) AddResources(r ...Resource)

type Container

type Container struct {
	XMLName             xml.Name `xml:"container" json:"-"`
	ChildCount          uint     `xml:"childCount,attr,omitempty" `
	ChildContainerCount uint     `xml:"childContainerCount,attr,omitempty" json:",omitempty"`
	Searchable          bool     `xml:"searchable,attr,omitempty" json:",omitempty"`

	Common

	Children []Object `json:",omitempty"`
}

Container contains other Objects

func (*Container) AddChildren

func (c *Container) AddChildren(cs ...Object)

func (Container) IsContainer

func (Container) IsContainer() bool

type DIDLLite

type DIDLLite struct {
	XMLName xml.Name `xml:"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ DIDL-Lite"`
	Objects []Object `xml:"xmlns:,omitempty"`
}

DIDLLite is the root element

func (*DIDLLite) AddObjects

func (d *DIDLLite) AddObjects(o ...Object)

func (*DIDLLite) MarshalXML

func (d *DIDLLite) MarshalXML(e *xml.Encoder, el xml.StartElement) error

type Duration

type Duration time.Duration

func (Duration) MarshalText

func (d Duration) MarshalText() (text []byte, err error)

func (Duration) String

func (d Duration) String() string

type Item

type Item struct {
	XMLName xml.Name `xml:"item" json:"-"`
	Common
}

Item is a group of related resources

func (Item) IsContainer

func (Item) IsContainer() bool

type Object

type Object interface {
	// contains filtered or unexported methods
}

Object is either an Item or a Container

type Resolution

type Resolution struct {
	Width  uint
	Height uint
}

func (*Resolution) MarshalText

func (r *Resolution) MarshalText() (text []byte, err error)

func (*Resolution) String

func (r *Resolution) String() string

type Resource

type Resource struct {
	ID           string `xml:"id,attr,omitempty"`
	ProtocolInfo string `xml:"protocolInfo",attr"`
	URI          string `xml:",chardata"`
	// contains filtered or unexported fields
}

Resource is a content to stream or download

func (*Resource) MarshalJSON

func (r *Resource) MarshalJSON() ([]byte, error)

func (*Resource) MarshalXML

func (r *Resource) MarshalXML(e *xml.Encoder, el xml.StartElement) error

func (*Resource) SetTag

func (r *Resource) SetTag(name, value string)

func (*Resource) Tags

func (r *Resource) Tags() map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL