request

package
v0.0.0-...-ecb31cf Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Requests are sent through channels for communication. It works like a mail system, every routine shares a channel which is regarded by themselves as a outport and they send out their requests for routines outside through it. And every routine holds a channel from where they receive outside requests. Thus a mail routine(usually main routine) is required to listen to the shared channel and dispatch requests there to their destination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination int
const (
	PANEL Destination = iota
	PLAYER
	MAIN // main routine
)

type Request

type Request struct {
	Req         RequestType
	Destination Destination
	Attachments interface{}
}

func NewRequestToMain

func NewRequestToMain(req RequestType, attachments interface{}) Request

func NewRequestToPanel

func NewRequestToPanel(req RequestType) Request

func NewRequestToPlayer

func NewRequestToPlayer(req RequestType) Request

type RequestType

type RequestType int
const (
	// request sent to player
	RequestRandomMode RequestType = iota
	RequestRepeatMode
	RequestSequentialMode
	RequestNextTrack
	RequestPrevTrack
	RequestStop

	// request sent to panel
	RequestClearAndStop

	// request sent to main routine
	RequestSetNewLibrary
)

Jump to

Keyboard shortcuts

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