Documentation
¶
Overview ¶
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Index ¶
- Constants
- func CORS() gin.HandlerFunc
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type EnableMode
- type Error
- type GinServerOptions
- type LoginHandler
- type MiddlewareFunc
- type MusicHandler
- type PostAuthTokenJSONBody
- type PostAuthTokenJSONRequestBody
- type PostMusicEnqueueServiceIdentifierJSONBody
- type PostMusicEnqueueServiceIdentifierJSONRequestBody
- type PostMusicLoopJSONRequestBody
- type PostMusicRadioJSONRequestBody
- type Server
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetMusicStatus(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostAuthToken(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostMusicEnqueueServiceIdentifier(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostMusicLoop(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostMusicRadio(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostMusicSkip(c *gin.Context)
- type Song
- type SongService
- type Token
Constants ¶
const (
JWTScopes = "JWT.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS() gin.HandlerFunc
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type EnableMode ¶
type EnableMode struct {
Enable *bool `binding:"required" json:"enable,omitempty"`
}
EnableMode defines model for Enable-mode.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc }
GinServerOptions provides options for the Gin server.
type LoginHandler ¶
type LoginHandler interface { PostAuthToken(c *gin.Context) Authorization() gin.HandlerFunc }
type MiddlewareFunc ¶
type MusicHandler ¶
type PostAuthTokenJSONBody ¶
type PostAuthTokenJSONBody struct { // Case-insensitive Login string `binding:"required" json:"login"` // Case-sensitive Password string `binding:"required" json:"password"` }
PostAuthTokenJSONBody defines parameters for PostAuthToken.
type PostAuthTokenJSONRequestBody ¶
type PostAuthTokenJSONRequestBody PostAuthTokenJSONBody
PostAuthTokenJSONRequestBody defines body for PostAuthToken for application/json ContentType.
type PostMusicEnqueueServiceIdentifierJSONBody ¶
type PostMusicEnqueueServiceIdentifierJSONBody struct {
Input string `binding:"required" json:"input"`
}
PostMusicEnqueueServiceIdentifierJSONBody defines parameters for PostMusicEnqueueServiceIdentifier.
type PostMusicEnqueueServiceIdentifierJSONRequestBody ¶
type PostMusicEnqueueServiceIdentifierJSONRequestBody PostMusicEnqueueServiceIdentifierJSONBody
PostMusicEnqueueServiceIdentifierJSONRequestBody defines body for PostMusicEnqueueServiceIdentifier for application/json ContentType.
type PostMusicLoopJSONRequestBody ¶
type PostMusicLoopJSONRequestBody EnableMode
PostMusicLoopJSONRequestBody defines body for PostMusicLoop for application/json ContentType.
type PostMusicRadioJSONRequestBody ¶
type PostMusicRadioJSONRequestBody EnableMode
PostMusicRadioJSONRequestBody defines body for PostMusicRadio for application/json ContentType.
type Server ¶
type Server struct { MusicHandler LoginHandler // contains filtered or unexported fields }
func NewServer ¶
func NewServer(music MusicHandler, login LoginHandler) *Server
func (*Server) RegisterHandlers ¶
func (s *Server) RegisterHandlers()
type ServerInterface ¶
type ServerInterface interface { // Login // (POST /auth/token) PostAuthToken(c *gin.Context) // Find and enqueue song // (POST /music/enqueue/{service}/{kind}) PostMusicEnqueueServiceIdentifier(c *gin.Context, service string, kind string) // Set loop mode // (POST /music/loop) PostMusicLoop(c *gin.Context) // Set radio mode // (POST /music/radio) PostMusicRadio(c *gin.Context) // Skip song // (POST /music/skip) PostMusicSkip(c *gin.Context) // Player status // (GET /music/status) GetMusicStatus(c *gin.Context) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetMusicStatus ¶
func (siw *ServerInterfaceWrapper) GetMusicStatus(c *gin.Context)
GetMusicStatus operation middleware
func (*ServerInterfaceWrapper) PostAuthToken ¶
func (siw *ServerInterfaceWrapper) PostAuthToken(c *gin.Context)
PostAuthToken operation middleware
func (*ServerInterfaceWrapper) PostMusicEnqueueServiceIdentifier ¶
func (siw *ServerInterfaceWrapper) PostMusicEnqueueServiceIdentifier(c *gin.Context)
PostMusicEnqueueServiceIdentifier operation middleware
func (*ServerInterfaceWrapper) PostMusicLoop ¶
func (siw *ServerInterfaceWrapper) PostMusicLoop(c *gin.Context)
PostMusicLoop operation middleware
func (*ServerInterfaceWrapper) PostMusicRadio ¶
func (siw *ServerInterfaceWrapper) PostMusicRadio(c *gin.Context)
PostMusicRadio operation middleware
func (*ServerInterfaceWrapper) PostMusicSkip ¶
func (siw *ServerInterfaceWrapper) PostMusicSkip(c *gin.Context)
PostMusicSkip operation middleware
type Song ¶
type Song struct { ArtistName string `json:"artist_name"` ArtistUrl string `json:"artist_url"` ArtworkUrl string `json:"artwork_url"` LastPlay time.Time `json:"last_play"` Playbacks int `json:"playbacks"` Service SongService `json:"service"` ThumbnailUrl string `json:"thumbnail_url"` Title string `json:"title"` Url string `json:"url"` }
The object that describes a song
type SongService ¶
type SongService string
SongService defines model for Song.Service.
const ( Unknown SongService = "unknown" Youtube SongService = "youtube" )
Defines values for SongService.