webserver

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationState

type ApplicationState struct {
	TxOn           bool                   `json:"tx_on"`
	RxVolume       int                    `json:"rx_volume"`
	TxVolume       int                    `json:"tx_volume"`
	Connected      bool                   `json:"connected"`
	AudioServers   map[string]AudioServer `json:"audio_servers"`
	SelectedServer string                 `json:"selected_server"`
	VoxEnabled     bool                   `json:"vox_enabled"`
	VoxThreshold   float32                `json:"vox_threshold"`
	VoxHoldtime    time.Duration          `json:"vox_holdtime"`
}

ApplicationState is a data structure is provided through the /api/v{version}/servers endpoint.

type AudioControlSelected

type AudioControlSelected struct {
	Selected *bool `json:"selected"`
}

AudioControlSelected is a data structure which can be get/set through the /api/v{version}/server{radio}/selected endpoint to select a particular remote audio.

type AudioControlState

type AudioControlState struct {
	On *bool `json:"on"`
}

AudioControlState is a data structure which can be get/set through the /api/v{version}/server{radio}/state endpoint. It is used to start & stop the audio stream of a remote audio server.

type AudioControlVolume

type AudioControlVolume struct {
	Volume *int `json:"volume"`
}

AudioControlVolume is a data structure which can be get/set through the /api/v{version}/rx/volume and /api/v{version}/tx/volume endpoints. It is used to adjust the local audio levels.

type AudioControlVox

type AudioControlVox struct {
	VoxActive    *bool          `json:"vox_active"`
	VoxEnabled   *bool          `json:"vox_enabled"`
	VoxThreshold *float32       `json:"vox_threshold"`
	VoxHoldtime  *time.Duration `json:"vox_holdtime"`
}

AudioControlVox is a data structure which can be get/set through the /api/v{version}/tx/vox endpoint. It is used to get / set the local vox settings.

type AudioServer

type AudioServer struct {
	Name    string `json:"name"`
	Index   int    `json:"index"`
	On      bool   `json:"rx_on"`
	TxUser  string `json:"tx_user"`
	Latency int    `json:"latency"`
}

AudioServer is a data structure which is provided through the /api/v{version}/server/{radio} endpoint.

type WebServer

type WebServer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

WebServer is the webserver's data structure holding internal variables.

func NewWebServer

func NewWebServer(url string, port int, trx *trx.Trx) (*WebServer, error)

NewWebServer is the constructor method for a remoteAudio web server. The web server is only available on clients.

func (*WebServer) Start

func (web *WebServer) Start()

Start will initialize the webserver and start serving on the designated interface & port.

Jump to

Keyboard shortcuts

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