command

package
v0.0.0-...-531a2f0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDestination = "receiver-0"
View Source
const DefaultSource = "sender-0"

Variables

View Source
var Close = Command{
	Envelope: connectionEnv,
	Payload:  Type("CLOSE"),
}
View Source
var Connect = Command{
	Envelope: connectionEnv,
	Payload:  Type("CONNECT"),
}

Functions

This section is empty.

Types

type App

type App struct {
	Envelope chromecast.Envelope
	Client   chromecast.Client
}

func ConnectFromStatus

func ConnectFromStatus(client chromecast.Client, st chromecast.Status, namespace string) (*App, error)

func ConnectTo

func ConnectTo(client chromecast.Client, destination string) (*App, error)

func LaunchAndConnect

func LaunchAndConnect(client chromecast.Client, id string, statuses ...chromecast.Status) (*App, error)

type Command

type Command struct {
	Envelope chromecast.Envelope
	Payload  interface{}
}

func (Command) Send

func (c Command) Send(sender chromecast.Sender) error

func (Command) SendTo

func (c Command) SendTo(sender chromecast.Sender, destination string) error

type Launcher

type Launcher struct {
	Requester chromecast.Requester
}

func (Launcher) AmpController

func (l Launcher) AmpController() chromecast.AmpController

AmpController returns an AmpController

func (Launcher) Launch

func (l Launcher) Launch(appID string, statuses ...chromecast.Status) (st chromecast.Status, err error)

Launch will launch the given app, except if it is found running in one of the optional statuses

func (Launcher) Mute

func (l Launcher) Mute(muted bool) (st chromecast.Status, err error)

func (Launcher) SetVolume

func (l Launcher) SetVolume(level float64) (st chromecast.Status, err error)

func (Launcher) Status

func (l Launcher) Status() (st chromecast.Status, err error)

func (Launcher) Stop

func (l Launcher) Stop() (st chromecast.Status, err error)

type Map

type Map map[string]interface{}

func (Map) SetRequestID

func (m Map) SetRequestID(ID uint32)

SetRequestID helps fullfills the chromecast.IdentifiablePayload interface

type Type

type Type string

func (Type) MarshalJSON

func (t Type) MarshalJSON() (b []byte, err error)

Jump to

Keyboard shortcuts

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