handlers

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAppAlreadyLaunched = fmt.Errorf("app already launched")

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func (*Connection) Connect

func (c *Connection) Connect()

func (*Connection) Disconnect

func (c *Connection) Disconnect()

func (*Connection) Dispatch

func (r *Connection) Dispatch(e events.Event)

func (*Connection) RegisterDispatch

func (r *Connection) RegisterDispatch(dispatch func(events.Event))

func (*Connection) RegisterRequest

func (r *Connection) RegisterRequest(send func(responses.Payload) (*api.CastMessage, error))

func (*Connection) RegisterSend

func (r *Connection) RegisterSend(send func(responses.Payload) error)

func (*Connection) Request

func (r *Connection) Request(p responses.Payload) (*api.CastMessage, error)

func (*Connection) Send

func (r *Connection) Send(p responses.Payload) error

func (*Connection) Unmarshal

func (c *Connection) Unmarshal(message string)

type Heartbeat

type Heartbeat struct {
	OnFailure func()
	// contains filtered or unexported fields
}

func NewHeartbeat

func NewHeartbeat() *Heartbeat

func (*Heartbeat) Connect

func (h *Heartbeat) Connect()

func (*Heartbeat) Disconnect

func (h *Heartbeat) Disconnect()

func (*Heartbeat) Dispatch

func (r *Heartbeat) Dispatch(e events.Event)

func (*Heartbeat) Ping

func (h *Heartbeat) Ping()

func (*Heartbeat) Pong

func (h *Heartbeat) Pong()

func (*Heartbeat) RegisterDispatch

func (r *Heartbeat) RegisterDispatch(dispatch func(events.Event))

func (*Heartbeat) RegisterRequest

func (r *Heartbeat) RegisterRequest(send func(responses.Payload) (*api.CastMessage, error))

func (*Heartbeat) RegisterSend

func (r *Heartbeat) RegisterSend(send func(responses.Payload) error)

func (*Heartbeat) Request

func (r *Heartbeat) Request(p responses.Payload) (*api.CastMessage, error)

func (*Heartbeat) Send

func (r *Heartbeat) Send(p responses.Payload) error

func (*Heartbeat) Unmarshal

func (h *Heartbeat) Unmarshal(message string)

Unmarshal takes the message and notifies our timeout goroutine to check if we get pong or not.

type LaunchRequest

type LaunchRequest struct {
	responses.Headers
	AppId string `json:"appId"`
}

type Media

type Media struct {
	// contains filtered or unexported fields
}

func (*Media) Connect

func (m *Media) Connect()

func (*Media) Disconnect

func (m *Media) Disconnect()

func (*Media) Dispatch

func (r *Media) Dispatch(e events.Event)

func (*Media) LoadMedia

func (c *Media) LoadMedia(media responses.MediaItem, currentTime int, autoplay bool, customData interface{}) error

func (*Media) Pause

func (m *Media) Pause()

func (*Media) Play

func (m *Media) Play()

func (*Media) RegisterDispatch

func (r *Media) RegisterDispatch(dispatch func(events.Event))

func (*Media) RegisterRequest

func (r *Media) RegisterRequest(send func(responses.Payload) (*api.CastMessage, error))

func (*Media) RegisterSend

func (r *Media) RegisterSend(send func(responses.Payload) error)

func (*Media) Request

func (r *Media) Request(p responses.Payload) (*api.CastMessage, error)

func (*Media) Seek

func (m *Media) Seek(currentTime int)

func (*Media) Send

func (r *Media) Send(p responses.Payload) error

func (*Media) Stop

func (m *Media) Stop()

func (*Media) Unmarshal

func (m *Media) Unmarshal(message string)

type Receiver

type Receiver struct {
	// contains filtered or unexported fields
}

func (*Receiver) Connect

func (r *Receiver) Connect()

func (*Receiver) Disconnect

func (r *Receiver) Disconnect()

func (*Receiver) Dispatch

func (r *Receiver) Dispatch(e events.Event)

func (*Receiver) GetSessionByAppId

func (r *Receiver) GetSessionByAppId(appId string) *responses.ApplicationSession

func (*Receiver) LaunchApp

func (r *Receiver) LaunchApp(appId string) error

func (*Receiver) RegisterDispatch

func (r *Receiver) RegisterDispatch(dispatch func(events.Event))

func (*Receiver) RegisterRequest

func (r *Receiver) RegisterRequest(send func(responses.Payload) (*api.CastMessage, error))

func (*Receiver) RegisterSend

func (r *Receiver) RegisterSend(send func(responses.Payload) error)

func (*Receiver) Request

func (r *Receiver) Request(p responses.Payload) (*api.CastMessage, error)

func (*Receiver) Send

func (r *Receiver) Send(p responses.Payload) error

func (*Receiver) SetVolume

func (r *Receiver) SetVolume(volume float64) (*api.CastMessage, error)

TODO maybe do 0-100 instead of 0.0 to 1.0?

func (*Receiver) Unmarshal

func (r *Receiver) Unmarshal(message string)

Jump to

Keyboard shortcuts

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