dealer

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dealer

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

func NewDealer

func NewDealer(dealerAddr librespot.GetAddressFunc, accessToken librespot.GetLogin5TokenFunc) *Dealer

func (*Dealer) Close

func (d *Dealer) Close()

func (*Dealer) Connect

func (d *Dealer) Connect() error

func (*Dealer) ReceiveMessage

func (d *Dealer) ReceiveMessage(uriPrefixes ...string) <-chan Message

func (*Dealer) ReceiveRequest

func (d *Dealer) ReceiveRequest(uri string) <-chan Request

type Message

type Message struct {
	Uri     string
	Headers map[string]string
	Payload []byte
}

type RawMessage

type RawMessage struct {
	Type         string            `json:"type"`
	Method       string            `json:"method"`
	Uri          string            `json:"uri"`
	Headers      map[string]string `json:"headers"`
	MessageIdent string            `json:"message_ident"`
	Key          string            `json:"key"`
	Payloads     []interface{}     `json:"payloads"`
	Payload      struct {
		Compressed []byte `json:"compressed"`
	} `json:"payload"`
}

type Reply

type Reply struct {
	Type    string `json:"type"`
	Key     string `json:"key"`
	Payload struct {
		Success bool `json:"success"`
	} `json:"payload"`
}

type Request

type Request struct {
	MessageIdent string
	Payload      RequestPayload
	// contains filtered or unexported fields
}

func (Request) Reply

func (req Request) Reply(success bool)

type RequestPayload

type RequestPayload struct {
	MessageId      uint32 `json:"message_id"`
	TargetAliasId  string `json:"target_alias_id"`
	SentByDeviceId string `json:"sent_by_device_id"`
	Command        struct {
		Endpoint         string                    `json:"endpoint"`
		SessionId        string                    `json:"session_id"`
		Data             []byte                    `json:"data"`
		Value            interface{}               `json:"value"`
		Position         int64                     `json:"position"`
		Relative         string                    `json:"relative"`
		Context          *connectpb.Context        `json:"context"`
		PlayOrigin       *connectpb.PlayOrigin     `json:"play_origin"`
		Track            *connectpb.ContextTrack   `json:"track"`
		PrevTracks       []*connectpb.ContextTrack `json:"prev_tracks"`
		NextTracks       []*connectpb.ContextTrack `json:"next_tracks"`
		RepeatingTrack   *bool                     `json:"repeating_track"`
		RepeatingContext *bool                     `json:"repeating_context"`
		ShufflingContext *bool                     `json:"shuffling_context"`
		LoggingParams    struct {
			CommandInitiatedTime int64    `json:"command_initiated_time"`
			PageInstanceIds      []string `json:"page_instance_ids"`
			InteractionIds       []string `json:"interaction_ids"`
			DeviceIdentifier     string   `json:"device_identifier"`
		} `json:"logging_params"`
		Options struct {
			RestorePaused       string `json:"restore_paused"`
			RestorePosition     string `json:"restore_position"`
			RestoreTrack        string `json:"restore_track"`
			AlwaysPlaySomething bool   `json:"always_play_something"`
			SkipTo              struct {
				TrackUid   string `json:"track_uid"`
				TrackUri   string `json:"track_uri"`
				TrackIndex int    `json:"track_index"`
			} `json:"skip_to"`
			InitiallyPaused       bool                                    `json:"initially_paused"`
			SystemInitiated       bool                                    `json:"system_initiated"`
			PlayerOptionsOverride *connectpb.ContextPlayerOptionOverrides `json:"player_options_override"`
			Suppressions          *connectpb.Suppressions                 `json:"suppressions"`
			PrefetchLevel         string                                  `json:"prefetch_level"`
			AudioStream           string                                  `json:"audio_stream"`
			SessionId             string                                  `json:"session_id"`
			License               string                                  `json:"license"`
		} `json:"options"`
		PlayOptions struct {
			OverrideRestrictions bool   `json:"override_restrictions"`
			OnlyForLocalDevice   bool   `json:"only_for_local_device"`
			SystemInitiated      bool   `json:"system_initiated"`
			Reason               string `json:"reason"`
			Operation            string `json:"operation"`
			Trigger              string `json:"trigger"`
		} `json:"play_options"`
		FromDeviceIdentifier string `json:"from_device_identifier"`
	} `json:"command"`
}

Jump to

Keyboard shortcuts

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