v1

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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

View Source
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 Error

type Error struct {
	Msg string `json:"msg"`
}

Error defines model for Error.

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 MiddlewareFunc func(c *gin.Context)

type MusicHandler

type MusicHandler interface {
	PostMusicEnqueueServiceIdentifier(c *gin.Context, service string, kind string)
	PostMusicLoop(c *gin.Context)
	PostMusicRadio(c *gin.Context)
	PostMusicSkip(c *gin.Context)
	GetMusicStatus(c *gin.Context)
}

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()

func (*Server) Run

func (s *Server) Run(ip, port, swagger string, debug bool)

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.

type Token

type Token struct {
	Token string `json:"token"`
}

Token defines model for Token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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