Connection represents the active session with the Roku API.
type Connection struct { AuthToken string }
func NewConnection(current *User) (*Connection, error)
NewConnection initializes a session. User can be nil
func (c *Connection) LinkCode() (*LinkCode, error)
RequestLinkCode requests a new activation code from the server
func (c *Connection) Playback(rokuId string) (*Playback, error)
Playback fetches the DASH manifest and DRM information.
func (c *Connection) User(link *LinkCode) (*User, error)
GetUser exchanges the LinkCode for a permanent User token.
type Dash struct { Body []byte Url *url.URL }
LinkCode represents the activation code displayed to the user.
type LinkCode struct { Code string }
func (l *LinkCode) String() string
String generates the user instructions
Playback represents the media playback metadata.
type Playback struct { Drm struct { Widevine struct { LicenseServer string } } Url string // MPD }
func (p *Playback) Dash() (*Dash, error)
func (p *Playback) Widevine(payload []byte) ([]byte, error)
Widevine fetches the license key
User represents the persistent saved account token.
type User struct { Token string }