model

package
v0.0.0-...-4b954a8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DontCare = Version(-1)

Functions

This section is empty.

Types

type ID

type ID string

func (ID) String

func (id ID) String() string

type PIN

type PIN string

func (PIN) String

func (p PIN) String() string

type PlaybackState

type PlaybackState int
const (
	Stopped PlaybackState = iota
	Playing
	Paused
)

func FromString

func FromString(s string) PlaybackState

func (PlaybackState) String

func (p PlaybackState) String() string

type Queue

type Queue struct {
	Queue    []ID
	Position int
	Paused   bool
	Version  Version
}

type Score

type Score struct {
	Base   int
	Line   int
	Golden int
}

func (Score) Total

func (s Score) Total() int

type Song

type Song struct {
	Title  string `json:"title"`
	Artist string `json:"artist"`
	Year   int    `json:"year"`
}

type State

type State struct {
	Playback PlaybackState
	Source   string
	Position time.Duration
	Length   time.Duration
	Scores   []Score
}

func (State) MarshalJSON

func (s State) MarshalJSON() ([]byte, error)

func (State) RelPos

func (s State) RelPos() float64

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) error

type Ticket

type Ticket struct {
	ID      ID       `json:"id"`
	Names   []string `json:"names,omitempty"`
	Version Version  `json:"version"`
}

func (Ticket) String

func (t Ticket) String() string

type Version

type Version int64

func (Version) Conflict

func (v Version) Conflict(other Version) bool

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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