go-chromecast: github.com/oliverpool/go-chromecast Index | Files | Directories

package chromecast

import "github.com/oliverpool/go-chromecast"

Index

Package Files

chromecast.go client.go device.go error.go logger.go status.go version.go

Constants

const ErrAppNotFound = ErrorString("app not found")

ErrAppNotFound is returned when a given app was not found

Variables

var Version = "dev" /* passed in by travis build */

type AmpController Uses

type AmpController interface {
    Mute(muted bool) error
    SetVolume(level float64) error
    Quit() error
}

type ApplicationSession Uses

type ApplicationSession struct {
    AppID       *string      `json:"appId,omitempty"`
    DisplayName *string      `json:"displayName,omitempty"`
    Namespaces  []*Namespace `json:"namespaces"`
    SessionID   *string      `json:"sessionId,omitempty"`
    StatusText  *string      `json:"statusText,omitempty"`
    TransportId *string      `json:"transportId,omitempty"`
}

type Client Uses

type Client interface {
    Listener
    Sender
    Requester
    Close() error
}

Client interface is too weak

type Device Uses

type Device struct {
    IP         net.IP
    Port       int
    Properties map[string]string
}

func (Device) Addr Uses

func (d Device) Addr() string

func (Device) ID Uses

func (d Device) ID() string

func (Device) Name Uses

func (d Device) Name() string

func (Device) Status Uses

func (d Device) Status() string

func (Device) Type Uses

func (d Device) Type() string

type Envelope Uses

type Envelope struct {
    Source, Destination, Namespace string
}

type ErrorString Uses

type ErrorString string

ErrorString represents some constant errors

func (ErrorString) Error Uses

func (e ErrorString) Error() string

Error returns the underlying error string

type IdentifiablePayload Uses

type IdentifiablePayload interface {
    SetRequestID(uint32)
}

type Launcher Uses

type Launcher interface {
    Launch(appID string) (Status, error)
    Stop() (Status, error)
}

type Listener Uses

type Listener interface {
    Listen(env Envelope, responseType string, ch chan<- []byte)
}

Listener allows to listen to specific messages and forward them (non-blocking) on ch

type Logger Uses

type Logger interface {
    Log(keyvals ...interface{}) error
}

Logger is for structured logging in services (like in https://github.com/go-kit/kit/tree/master/log)

type Namespace Uses

type Namespace struct {
    Name string `json:"name"`
}

type PayloadWithID Uses

type PayloadWithID struct {
    Type      string  `json:"type"`
    RequestID *uint32 `json:"requestId,omitempty"`
}

func (*PayloadWithID) SetRequestID Uses

func (p *PayloadWithID) SetRequestID(id uint32)

type Requester Uses

type Requester interface {
    Request(env Envelope, payload IdentifiablePayload) (<-chan []byte, error)
}

Requester sends a payload and expects one payload as reply

type Scanner Uses

type Scanner interface {
    // Scan scans for chromecast and pushes them onto the results channel (eventually multiple times)
    // It must close the results channel before returning when the ctx is done
    Scan(ctx context.Context, results chan<- *Device) error
}

type Sender Uses

type Sender interface {
    Send(env Envelope, payload interface{}) error
}

Sender sends a payload (without expecting a reply)

type Serializer Uses

type Serializer interface {
    Receive() (Envelope, []byte, error)
    Send(Envelope, []byte) error
}

type Status Uses

type Status struct {
    Applications []*ApplicationSession `json:"applications"`
    Volume       *Volume               `json:"volume,omitempty"`
}

func (Status) AppSupporting Uses

func (st Status) AppSupporting(namespace string) (apps []ApplicationSession)

func (Status) AppWithID Uses

func (st Status) AppWithID(id string) *ApplicationSession

func (Status) FirstDestinationSupporting Uses

func (st Status) FirstDestinationSupporting(namespace string) (string, error)

func (Status) String Uses

func (st Status) String() string

type StatusResponse Uses

type StatusResponse struct {
    Status *Status `json:"status"`
}

type Volume Uses

type Volume struct {
    Level *float64 `json:"level,omitempty"`
    Muted *bool    `json:"muted,omitempty"`
}

Directories

PathSynopsis
cli
client
cli/local
command
command/heartbeat
command/media
command/media/bitmovin
command/media/defaultreceiver
command/media/defaultreceiver/tatort
command/media/defaultreceiver/tvnow
command/media/defaultreceiver/vimeo
command/media/vimeo
command/media/youtube
command/urlreceiver
discovery
discovery/mdns
discovery/zeroconf
gogoprotobuf
gogoprotobuf/pbPackage pb is a generated protocol buffer package.
log
mock
net
streak

Package chromecast imports 4 packages (graph) and is imported by 19 packages. Updated 2020-04-06. Refresh now. Tools for package owners.