Documentation ¶
Overview ¶
Package castv2 provides a low-level implementation of Google Cast V2 protocol.
Index ¶
Constants ¶
const ( PlatformSenderID = "sender-0" PlatformReceiverID = "receiver-0" )
Sender and receiver IDs to use for platform messages.
const ( NamespaceConnection = "urn:x-cast:com.google.cast.tp.connection" NamespaceHeartbeat = "urn:x-cast:com.google.cast.tp.heartbeat" NamespaceReceiver = "urn:x-cast:com.google.cast.receiver" NamespaceMedia = "urn:x-cast:com.google.cast.media" )
Reserved message namespaces for internal messages.
const ( TypeConnect = "CONNECT" TypeClose = "CLOSE" TypePing = "PING" TypePong = "PONG" TypeGetStatus = "GET_STATUS" TypeReceiverStatus = "RECEIVER_STATUS" TypeMediaStatus = "MEDIA_STATUS" TypeLaunch = "LAUNCH" TypeLoad = "LOAD" TypePlay = "PLAY" TypePause = "PAUSE" TypeStop = "STOP" TypeSeek = "SEEK" TypeSetVolume = "SET_VOLUME" )
Cast application protocol message types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel represents a cast channel to the receiver device.
It also manages the virtual connections. If a messages will be sent to a new source and destination ID pair, a virtual connection will be automatically established and keeped alive.
func (*Channel) Close ¶
Close terminates all established virtual connections and then closes the underying TLS connection.
func (*Channel) Subscribe ¶
Subscribe registers a subscription to broadcast messages. It returns an identifier for identifying the subscription when unsubscribing.
func (*Channel) Unsubscribe ¶
Unsubscribe unregisters the subscription and closes the subscription channel.
type Header ¶
Header contains the required fields in most payload types.
func (*Header) SetRequestID ¶
SetRequestID sets the requestId header.
type Msg ¶
Msg is a Cast V2 protocol data unit with textual payload.
func (*Msg) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Msg) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.