xspf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XmlVersion  = "1"
	Xmlns       = "http://xspf.org/ns/0/"
	ContentType = "application/xspf+xml"
)

Variables

This section is empty.

Functions

func BufferedGenerate

func BufferedGenerate(list *PlayList) (*bytes.Buffer, error)

Same as Generate, but save contents to bytes buffer instead of directly write it to stream

func EncodeXspf added in v0.3.0

func EncodeXspf(w io.Writer, list *PlayList) error

Encode PlayList struct to xspf xml element without xml header

func Generate

func Generate(w io.Writer, list *PlayList) error

Generate xspf playlist with xml header from PlayList struct

Types

type PlayList

type PlayList struct {
	Title      string   `xml:"title,omitempty"`
	Creator    string   `xml:"creator,omitempty"`
	Date       string   `xml:"date,omitempty"`
	Annotation string   `xml:"annotation,omitempty"`
	Tracks     []*Track `xml:"trackList>track"`
}

func DecodeXspf added in v1.0.0

func DecodeXspf(r io.Reader) (*PlayList, error)

Decode xspf xml element to PlayList struct

type Track

type Track struct {
	Location   string `xml:"location"`
	Title      string `xml:"title,omitempty"`
	Creator    string `xml:"creator,omitempty"`
	Album      string `xml:"album,omitempty"`
	TrackNum   string `xml:"trackNum,omitempty"`
	Duration   string `xml:"duration,omitempty"`
	ImageExt   string `xml:"-"`
	Image      string `xml:"image,omitempty"`
	Annotation string `xml:"annotation,omitempty"`
}

Jump to

Keyboard shortcuts

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