data

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Command string `json:"cmd"`

	channel.NeverEqual
	channel.NoClose
}

func BinaryMessage

func BinaryMessage(r channel.BinaryReader) (Message, error)

func JSONMessage

func JSONMessage(r io.Reader) (Message, io.Reader, error)

func (Message) Binary

func (m Message) Binary(w channel.BinaryWriter) error

func (Message) FromBinary

func (m Message) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (Message) FromJSON

func (m Message) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (Message) JSON

func (m Message) JSON(w io.Writer) error

type NodeMessage

type NodeMessage struct {
	NS       string
	ID       string
	Playlist string

	channel.NoClose
}

func BinaryNodeMessage

func BinaryNodeMessage(r channel.BinaryReader) (NodeMessage, error)

func JSONNodeMessage

func JSONNodeMessage(r io.Reader) (NodeMessage, io.Reader, error)

func (NodeMessage) Binary

func (m NodeMessage) Binary(r channel.BinaryWriter) error

func (NodeMessage) Equal

func (m NodeMessage) Equal(msg channel.Msg) bool

func (NodeMessage) FromBinary

func (m NodeMessage) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (NodeMessage) FromJSON

func (m NodeMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (NodeMessage) JSON

func (m NodeMessage) JSON(w io.Writer) error

type ServerMessage

type ServerMessage struct {
	View  byte   `json:"view"`
	Title string `json:"title"`
	Text  string `json:"text"`
	Songs []Song `json:"songs"`

	channel.NoClose
}

func BinaryServerMessage

func BinaryServerMessage(r channel.BinaryReader) (ServerMessage, error)

func JSONServerMessage

func JSONServerMessage(r io.Reader) (ServerMessage, io.Reader, error)

func (ServerMessage) Binary

func (ServerMessage) Equal

func (m ServerMessage) Equal(msg channel.Msg) bool

func (ServerMessage) FromBinary

func (m ServerMessage) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (ServerMessage) FromJSON

func (m ServerMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (ServerMessage) JSON

func (m ServerMessage) JSON(w io.Writer) error

type ServerPlaylistMessage

type ServerPlaylistMessage struct {
	List []string `json:"list"`

	channel.NoClose
}

func BinaryServerPlaylistMessage

func BinaryServerPlaylistMessage(r channel.BinaryReader) (ServerPlaylistMessage, error)

func JSONServerPlaylistMessage

func JSONServerPlaylistMessage(r io.Reader) (ServerPlaylistMessage, io.Reader, error)

func (ServerPlaylistMessage) Binary

func (ServerPlaylistMessage) Equal

func (m ServerPlaylistMessage) Equal(msg channel.Msg) bool

func (ServerPlaylistMessage) FromBinary

func (ServerPlaylistMessage) FromJSON

func (ServerPlaylistMessage) JSON

type ServerSongMessage

type ServerSongMessage struct {
	Song
	channel.NoClose
}

func BinaryServerSongMessage

func BinaryServerSongMessage(r channel.BinaryReader) (ServerSongMessage, error)

func JSONServerSongMessage

func JSONServerSongMessage(r io.Reader) (ServerSongMessage, io.Reader, error)

func (ServerSongMessage) Equal

func (m ServerSongMessage) Equal(msg channel.Msg) bool

func (ServerSongMessage) FromBinary

func (ServerSongMessage) FromJSON

func (m ServerSongMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (ServerSongMessage) JSON

func (m ServerSongMessage) JSON(w io.Writer) error

type ServerStateMessage

type ServerStateMessage struct {
	Paused   bool          `json:"paused"`
	Position time.Duration `json:"position"`
	Duration time.Duration `json:"duration"`
	Volume   float64       `json:"volume"`

	channel.NoClose
}

func BinaryServerStateMessage

func BinaryServerStateMessage(r channel.BinaryReader) (ServerStateMessage, error)

func JSONServerStateMessage

func JSONServerStateMessage(r io.Reader) (ServerStateMessage, io.Reader, error)

func (ServerStateMessage) Binary

func (ServerStateMessage) Equal

func (m ServerStateMessage) Equal(msg channel.Msg) bool

func (ServerStateMessage) FromBinary

func (ServerStateMessage) FromJSON

func (m ServerStateMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (ServerStateMessage) JSON

func (m ServerStateMessage) JSON(w io.Writer) error

type Song

type Song struct {
	P_NS    string `json:"ns"`
	P_ID    string `json:"id"`
	P_Title string `json:"title"`
	Active  bool   `json:"a"`
	Problem string `json:"problem"`
}

func BinarySong

func BinarySong(r channel.BinaryReader) (Song, error)

func (Song) Binary

func (s Song) Binary(w channel.BinaryWriter) error

func (Song) ID

func (s Song) ID() string

func (Song) NS

func (s Song) NS() string

func (Song) Title

func (s Song) Title() string

type SongDataMessage

type SongDataMessage struct {
	Available bool
	Song      Song
	Size      int64

	channel.NeverEqual
	// contains filtered or unexported fields
}

func BinarySongDataMessage

func BinarySongDataMessage(r channel.BinaryReader) (SongDataMessage, error)

func JSONSongDataMessage

func JSONSongDataMessage(r io.Reader) (SongDataMessage, io.Reader, error)

func NewNoSongDataMessage

func NewNoSongDataMessage() SongDataMessage

func NewSongDataMessage

func NewSongDataMessage(song Song, size int64, r io.Reader) SongDataMessage

func (SongDataMessage) Binary

func (SongDataMessage) Close

func (m SongDataMessage) Close() error

func (SongDataMessage) FromBinary

func (m SongDataMessage) FromBinary(r channel.BinaryReader) (channel.Msg, error)

func (SongDataMessage) FromJSON

func (m SongDataMessage) FromJSON(r io.Reader) (channel.Msg, io.Reader, error)

func (SongDataMessage) JSON

func (m SongDataMessage) JSON(w io.Writer) error

func (SongDataMessage) Upload

func (m SongDataMessage) Upload() io.Reader

Jump to

Keyboard shortcuts

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