spiff

package
v0.0.0-...-5edc56a Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMusic   = "music"
	TypeVideo   = "video"
	TypePodcast = "podcast"
	TypeStream  = "stream"
)
View Source
const (
	ContentType = "application/json-patch+json"
)

Variables

This section is empty.

Functions

func Compare

func Compare(before, after []byte) (bool, error)

func Patch

func Patch(data []byte, patch []byte) ([]byte, error)

Types

type Entry

type Entry struct {
	Ref        string   `json:"$ref,omitempty"`
	Creator    string   `json:"creator,omitempty" spiff:"creator"`
	Album      string   `json:"album,omitempty" spiff:"album"`
	Title      string   `json:"title,omitempty" spiff:"title"`
	Image      string   `json:"image,omitempty" spiff:"image"`
	Location   []string `json:"location,omitempty" spiff:"location"`
	Identifier []string `json:"identifier,omitempty" spiff:"identifier"`
	Size       []int64  `json:"size,omitempty"`
	Date       string   `json:"date,omitempty" spiff:"date"` // "2005-01-08T17:10:47-05:00",
}
type Header struct {
	Title    string `json:"title"`
	Creator  string `json:"creator,omitempty"`
	Image    string `json:"image,omitempty"`
	Location string `json:"location,omitempty"`
	Date     string `json:"date,omitempty"` // "2005-01-08T17:10:47-05:00",
}

type Playlist

type Playlist struct {
	Spiff    Spiff   `json:"playlist"`
	Index    int     `json:"index"`
	Position float64 `json:"position"`
	Type     string  `json:"type"`
}

func NewPlaylist

func NewPlaylist(listType string) *Playlist

func Unmarshal

func Unmarshal(data []byte) (*Playlist, error)

func (*Playlist) Marshal

func (playlist *Playlist) Marshal() ([]byte, error)

type Spiff

type Spiff struct {
	// Title    string  `json:"title"`
	// Creator  string  `json:"creator,omitempty"`
	// Image    string  `json:"image,omitempty"`
	// Location string  `json:"location,omitempty"`
	// Date     string  `json:"date,omitempty"` // "2005-01-08T17:10:47-05:00",
	Header
	Entries []Entry `json:"track"`
}

Jump to

Keyboard shortcuts

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