openapi

package
v0.0.0-...-1e8465d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertErr

func ConvertErr(err error) error

func ConvertNotification

func ConvertNotification(notification Notification) ([]byte, error)

func ConvertPlaybackError

func ConvertPlaybackError(e android.PlaybackError) string

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Error

type Error struct {
	Message string `json:"message"`
}

Error defines model for Error.

type Event

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

Event defines model for Event.

func (Event) AsEventDataNotification

func (t Event) AsEventDataNotification() (EventDataNotification, error)

AsEventDataNotification returns the union data inside the Event as a EventDataNotification

func (Event) AsEventDataPlayerState

func (t Event) AsEventDataPlayerState() (EventDataPlayerState, error)

AsEventDataPlayerState returns the union data inside the Event as a EventDataPlayerState

func (Event) AsEventDataPlayerStatePartial

func (t Event) AsEventDataPlayerStatePartial() (EventDataPlayerStatePartial, error)

AsEventDataPlayerStatePartial returns the union data inside the Event as a EventDataPlayerStatePartial

func (Event) Discriminator

func (t Event) Discriminator() (string, error)

func (*Event) FromEventDataNotification

func (t *Event) FromEventDataNotification(v EventDataNotification) error

FromEventDataNotification overwrites any union data inside the Event as the provided EventDataNotification

func (*Event) FromEventDataPlayerState

func (t *Event) FromEventDataPlayerState(v EventDataPlayerState) error

FromEventDataPlayerState overwrites any union data inside the Event as the provided EventDataPlayerState

func (*Event) FromEventDataPlayerStatePartial

func (t *Event) FromEventDataPlayerStatePartial(v EventDataPlayerStatePartial) error

FromEventDataPlayerStatePartial overwrites any union data inside the Event as the provided EventDataPlayerStatePartial

func (Event) MarshalJSON

func (t Event) MarshalJSON() ([]byte, error)

func (*Event) MergeEventDataNotification

func (t *Event) MergeEventDataNotification(v EventDataNotification) error

MergeEventDataNotification performs a merge with any union data inside the Event, using the provided EventDataNotification

func (*Event) MergeEventDataPlayerState

func (t *Event) MergeEventDataPlayerState(v EventDataPlayerState) error

MergeEventDataPlayerState performs a merge with any union data inside the Event, using the provided EventDataPlayerState

func (*Event) MergeEventDataPlayerStatePartial

func (t *Event) MergeEventDataPlayerStatePartial(v EventDataPlayerStatePartial) error

MergeEventDataPlayerStatePartial performs a merge with any union data inside the Event, using the provided EventDataPlayerStatePartial

func (*Event) UnmarshalJSON

func (t *Event) UnmarshalJSON(b []byte) error

func (Event) ValueByDiscriminator

func (t Event) ValueByDiscriminator() (interface{}, error)

type EventBase

type EventBase struct {
	Type EventType `json:"type"`
}

EventBase defines model for EventBase.

type EventDataNotification

type EventDataNotification struct {
	Data Notification `json:"data"`
	Type EventType    `json:"type"`
}

EventDataNotification defines model for EventDataNotification.

type EventDataPlayerState

type EventDataPlayerState struct {
	Data []PlayerState `json:"data"`
	Type EventType     `json:"type"`
}

EventDataPlayerState defines model for EventDataPlayerState.

type EventDataPlayerStatePartial

type EventDataPlayerStatePartial struct {
	Data []PlayerStatePartial `json:"data"`
	Type EventType            `json:"type"`
}

EventDataPlayerStatePartial defines model for EventDataPlayerStatePartial.

type EventType

type EventType string

EventType defines model for EventType.

const (
	EventTypeNotification       EventType = "notification"
	EventTypePlayerState        EventType = "player_state"
	EventTypePlayerStatePartial EventType = "player_state_partial"
)

Defines values for EventType.

type Notification

type Notification struct {
	Description string `json:"description"`
	Error       bool   `json:"error"`
	Title       string `json:"title"`
}

Notification defines model for Notification.

type PlayerPlaybackState

type PlayerPlaybackState string

PlayerPlaybackState defines model for PlayerPlaybackState.

const (
	BUFFERING PlayerPlaybackState = "BUFFERING"
	ENDED     PlayerPlaybackState = "ENDED"
	IDLE      PlayerPlaybackState = "IDLE"
	READY     PlayerPlaybackState = "READY"
)

Defines values for PlayerPlaybackState.

func ConvertPlayerPlaybackState

func ConvertPlayerPlaybackState(s android.PlaybackState) PlayerPlaybackState

type PlayerState

type PlayerState struct {
	Connected               bool                `json:"connected"`
	Genre                   string              `json:"genre"`
	Id                      int64               `json:"id"`
	Loading                 bool                `json:"loading"`
	MaxVolume               int                 `json:"max_volume"`
	MinVolume               int                 `json:"min_volume"`
	Muted                   bool                `json:"muted"`
	Name                    string              `json:"name"`
	PlaybackError           string              `json:"playback_error"`
	PlaybackState           PlayerPlaybackState `json:"playback_state"`
	Playing                 bool                `json:"playing"`
	Position                int64               `json:"position"`
	PositionTime            time.Time           `json:"position_time"`
	Ready                   bool                `json:"ready"`
	Station                 string              `json:"station"`
	TimelineDefaultPosition int64               `json:"timeline_default_position"`
	TimelineDuration        int64               `json:"timeline_duration"`
	TimelineIsLive          bool                `json:"timeline_is_live"`
	TimelineIsPlaceholder   bool                `json:"timeline_is_placeholder"`
	TimelineIsSeekable      bool                `json:"timeline_is_seekable"`
	Title                   string              `json:"title"`
	Uri                     string              `json:"uri"`
	Volume                  int                 `json:"volume"`
}

PlayerState defines model for PlayerState.

func ConvertPlayerState

func ConvertPlayerState(s *android.State, p core.Player) PlayerState

func ConvertPlayerStates

func ConvertPlayerStates(states []android.State, players []core.Player) []PlayerState

type PlayerStatePartial

type PlayerStatePartial struct {
	Connected               *bool                `json:"connected,omitempty"`
	Genre                   *string              `json:"genre,omitempty"`
	Id                      int64                `json:"id"`
	Loading                 *bool                `json:"loading,omitempty"`
	MaxVolume               *int                 `json:"max_volume,omitempty"`
	MinVolume               *int                 `json:"min_volume,omitempty"`
	Muted                   *bool                `json:"muted,omitempty"`
	Name                    *string              `json:"name,omitempty"`
	PlaybackError           *string              `json:"playback_error,omitempty"`
	PlaybackState           *PlayerPlaybackState `json:"playback_state,omitempty"`
	Playing                 *bool                `json:"playing,omitempty"`
	Position                *int64               `json:"position,omitempty"`
	PositionTime            *time.Time           `json:"position_time,omitempty"`
	Ready                   *bool                `json:"ready,omitempty"`
	Station                 *string              `json:"station,omitempty"`
	TimelineDefaultPosition *int64               `json:"timeline_default_position,omitempty"`
	TimelineDuration        *int64               `json:"timeline_duration,omitempty"`
	TimelineIsLive          *bool                `json:"timeline_is_live,omitempty"`
	TimelineIsPlaceholder   *bool                `json:"timeline_is_placeholder,omitempty"`
	TimelineIsSeekable      *bool                `json:"timeline_is_seekable,omitempty"`
	Title                   *string              `json:"title,omitempty"`
	Uri                     *string              `json:"uri,omitempty"`
	Volume                  *int                 `json:"volume,omitempty"`
}

PlayerStatePartial defines model for PlayerStatePartial.

func ConvertPlayerStatePartial

func ConvertPlayerStatePartial(s *android.State, c diff.Changed) PlayerStatePartial

type ServerInterface

type ServerInterface interface {

	// (GET /players/{id}/qr)
	GetPlayersIdQr(ctx echo.Context, id int64) error

	// (GET /sources/{id}/{slug*})
	GetSourcesIdSlug(ctx echo.Context, id int64, slug string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetPlayersIdQr

func (w *ServerInterfaceWrapper) GetPlayersIdQr(ctx echo.Context) error

GetPlayersIdQr converts echo context to params.

func (*ServerInterfaceWrapper) GetSourcesIdSlug

func (w *ServerInterfaceWrapper) GetSourcesIdSlug(ctx echo.Context) error

GetSourcesIdSlug converts echo context to params.

Jump to

Keyboard shortcuts

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