Documentation ¶
Index ¶
- func GetPresetURLNew(store store.Store, url string) echo.HandlerFunc
- func Router(a API, fs fs.FS) *echo.Echo
- func Start(e *echo.Echo, port int) error
- type API
- func (a API) DeleteRadio(c echo.Context) error
- func (a API) DiscoverRadios(c echo.Context) error
- func (a API) GetBuild(c echo.Context) error
- func (a API) GetPreset(c echo.Context) error
- func (a API) GetRadio(c echo.Context) error
- func (a API) GetState(c echo.Context) error
- func (a API) ListPresets(c echo.Context) error
- func (a API) ListRadios(c echo.Context) error
- func (a API) ListStates(c echo.Context) error
- func (a API) PostState(c echo.Context) error
- func (a API) RadioMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (a API) RefreshRadioSubscription(c echo.Context) error
- func (a API) RefreshRadioVolume(c echo.Context) error
- func (a API) UpdatePreset(c echo.Context) error
- func (a API) WS(upgrader *websocket.Upgrader) echo.HandlerFunc
- type HTTPError
- type PostState
- type RadioContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPresetURLNew ¶
Types ¶
type API ¶
func (API) DeleteRadio ¶
@Summary Delete radio @Tags radios @Param uuid path string true "Radio UUID" @Produce json @Success 200 @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /radios/{uuid} [delete]
func (API) DiscoverRadios ¶
@Summary Discover radios @Tags radios @Produce json @Success 200 @Failure 409 {object} HTTPError "Discovery already in progress" @Failure 500 {object} HTTPError @Router /radios [post]
func (API) GetBuild ¶
@Summary Get build @Tags build @Produce json @Success 200 {object} model.Build @Router /build [get]
func (API) GetPreset ¶
@Summary Get preset @Tags presets @Param url path string true "Preset URL" @Produce json @Success 200 {object} model.Preset @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /presets/{url} [get]
func (API) GetRadio ¶
@Summary Get radio @Tags radios @Param uuid path string true "Radio UUID" @Produce json @Success 200 {object} model.Radio @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /radios/{uuid} [get]
func (API) GetState ¶
@Summary Get state @Tags states @Param uuid path string true "Radio UUID" @Produce json @Success 200 {object} state.State @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /states/{uuid} [get]
func (API) ListPresets ¶
@Summary List presets @Tags presets @Produce json @Success 200 {array} model.Preset @Failure 500 {object} HTTPError @Router /presets [get]
func (API) ListRadios ¶
@Summary List radios @Tags radios @Produce json @Success 200 {array} model.Radio @Router /radios [get]
func (API) ListStates ¶
@Summary List states @Tags states @Produce json @Success 200 {array} state.State @Router /states [get]
func (API) PostState ¶
@Summary Update state @Tags states @Param uuid path string true "Radio UUID" @Param state body PostState true "Patch state" @Success 200 @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /states/{uuid} [post]
func (API) RadioMiddleware ¶
func (a API) RadioMiddleware(next echo.HandlerFunc) echo.HandlerFunc
func (API) RefreshRadioSubscription ¶
@Summary Refresh radio subscription @Tags radios @Param uuid path string true "Radio UUID" @Produce json @Success 200 @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /radios/{uuid}/subscription [post]
func (API) RefreshRadioVolume ¶
@Summary Refresh radio volume @Tags radios @Param uuid path string true "Radio UUID" @Produce json @Success 200 @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /radios/{uuid}/volume [post]
func (API) UpdatePreset ¶
@Summary Update preset @Tags presets @Param preset body model.Preset true "Preset" @Produce json @Success 200 @Failure 400 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /presets [post]
type PostState ¶
type PostState struct { Power *bool `json:"power,omitempty" validate:"optional"` AudioSource *string `json:"audio_source,omitempty" validate:"optional"` Preset *int `json:"preset,omitempty" validate:"optional"` Volume *int `json:"volume,omitempty" validate:"optional"` VolumeDelta *int `json:"volume_delta,omitempty" validate:"optional"` }