Documentation
¶
Index ¶
- Variables
- func AssertAuthLoginPostRequestRequired(obj AuthLoginPostRequest) error
- func AssertLyricsImportStatusRequired(obj LyricsImportStatus) error
- func AssertLyricsRequired(obj Lyrics) error
- func AssertMessageRequired(obj Message) error
- func AssertModel401UnauthorizedRequired(obj Model401Unauthorized) error
- func AssertModel404NotFoundRequired(obj Model404NotFound) error
- func AssertModel500InternalErrorRequired(obj Model500InternalError) error
- func AssertOAuthConfigurationRequired(obj OAuthConfiguration) error
- func AssertOAuthUserInfoRequired(obj OAuthUserInfo) error
- func AssertPaginationMetadataRequired(obj PaginationMetadata) error
- func AssertPlaylistInfoRequired(obj PlaylistInfo) error
- func AssertPlaylistsGet200ResponseRequired(obj PlaylistsGet200Response) error
- func AssertRecurseAuthLoginPostRequestRequired(objSlice interface{}) error
- func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error
- func AssertRecurseLyricsImportStatusRequired(objSlice interface{}) error
- func AssertRecurseLyricsRequired(objSlice interface{}) error
- func AssertRecurseMessageRequired(objSlice interface{}) error
- func AssertRecurseModel401UnauthorizedRequired(objSlice interface{}) error
- func AssertRecurseModel404NotFoundRequired(objSlice interface{}) error
- func AssertRecurseModel500InternalErrorRequired(objSlice interface{}) error
- func AssertRecurseOAuthConfigurationRequired(objSlice interface{}) error
- func AssertRecurseOAuthUserInfoRequired(objSlice interface{}) error
- func AssertRecursePaginationMetadataRequired(objSlice interface{}) error
- func AssertRecursePlaylistInfoRequired(objSlice interface{}) error
- func AssertRecursePlaylistsGet200ResponseRequired(objSlice interface{}) error
- func AssertRecurseTrackDetailAllOfRequired(objSlice interface{}) error
- func AssertRecurseTrackDetailRequired(objSlice interface{}) error
- func AssertRecurseTrackInfoRequired(objSlice interface{}) error
- func AssertRecurseTracksGet200ResponseRequired(objSlice interface{}) error
- func AssertRecurseTracksStatsRequired(objSlice interface{}) error
- func AssertRecurseUserResponseRequired(objSlice interface{}) error
- func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error
- func AssertTrackDetailAllOfRequired(obj TrackDetailAllOf) error
- func AssertTrackDetailRequired(obj TrackDetail) error
- func AssertTrackInfoRequired(obj TrackInfo) error
- func AssertTracksGet200ResponseRequired(obj TracksGet200Response) error
- func AssertTracksStatsRequired(obj TracksStats) error
- func AssertUserResponseRequired(obj UserResponse) error
- func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
- func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, w http.ResponseWriter) error
- func IsZeroValue(val interface{}) bool
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type AuthApiController
- func (c *AuthApiController) AuthConfigurationGet(w http.ResponseWriter, r *http.Request)
- func (c *AuthApiController) AuthLoginPost(w http.ResponseWriter, r *http.Request)
- func (c *AuthApiController) AuthLogoutGet(w http.ResponseWriter, r *http.Request)
- func (c *AuthApiController) AuthRefreshGet(w http.ResponseWriter, r *http.Request)
- func (c *AuthApiController) Routes() Routes
- type AuthApiOption
- type AuthApiRouter
- type AuthApiServicer
- type AuthLoginPostRequest
- type ErrorHandler
- type ImplResponse
- type ImportApiController
- func (c *ImportApiController) ImportLibraryPost(w http.ResponseWriter, r *http.Request)
- func (c *ImportApiController) ImportLyricsGet(w http.ResponseWriter, r *http.Request)
- func (c *ImportApiController) ImportLyricsPost(w http.ResponseWriter, r *http.Request)
- func (c *ImportApiController) ImportLyricsTrackIdPost(w http.ResponseWriter, r *http.Request)
- func (c *ImportApiController) ImportPlaylistIdPost(w http.ResponseWriter, r *http.Request)
- func (c *ImportApiController) Routes() Routes
- type ImportApiOption
- type ImportApiRouter
- type ImportApiServicer
- type Lyrics
- type LyricsImportStatus
- type Message
- type Model401Unauthorized
- type Model404NotFound
- type Model500InternalError
- type OAuthConfiguration
- type OAuthUserInfo
- type PaginationMetadata
- type ParsingError
- type PlaylistInfo
- type PlaylistsApiController
- type PlaylistsApiOption
- type PlaylistsApiRouter
- type PlaylistsApiServicer
- type PlaylistsGet200Response
- type RequiredError
- type Route
- type Router
- func NewAuthApiController(s AuthApiServicer, opts ...AuthApiOption) Router
- func NewImportApiController(s ImportApiServicer, opts ...ImportApiOption) Router
- func NewPlaylistsApiController(s PlaylistsApiServicer, opts ...PlaylistsApiOption) Router
- func NewTracksApiController(s TracksApiServicer, opts ...TracksApiOption) Router
- type Routes
- type TrackDetail
- type TrackDetailAllOf
- type TrackInfo
- type TracksApiController
- func (c *TracksApiController) Routes() Routes
- func (c *TracksApiController) TracksGet(w http.ResponseWriter, r *http.Request)
- func (c *TracksApiController) TracksIdGet(w http.ResponseWriter, r *http.Request)
- func (c *TracksApiController) TracksIdPatch(w http.ResponseWriter, r *http.Request)
- func (c *TracksApiController) TracksStatsGet(w http.ResponseWriter, r *http.Request)
- type TracksApiOption
- type TracksApiRouter
- type TracksApiServicer
- type TracksGet200Response
- type TracksStats
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypeAssertionError is thrown when type an interface does not match the asserted type ErrTypeAssertionError = errors.New("unable to assert type") )
Functions ¶
func AssertAuthLoginPostRequestRequired ¶
func AssertAuthLoginPostRequestRequired(obj AuthLoginPostRequest) error
AssertAuthLoginPostRequestRequired checks if the required fields are not zero-ed
func AssertLyricsImportStatusRequired ¶
func AssertLyricsImportStatusRequired(obj LyricsImportStatus) error
AssertLyricsImportStatusRequired checks if the required fields are not zero-ed
func AssertLyricsRequired ¶
AssertLyricsRequired checks if the required fields are not zero-ed
func AssertMessageRequired ¶
AssertMessageRequired checks if the required fields are not zero-ed
func AssertModel401UnauthorizedRequired ¶
func AssertModel401UnauthorizedRequired(obj Model401Unauthorized) error
AssertModel401UnauthorizedRequired checks if the required fields are not zero-ed
func AssertModel404NotFoundRequired ¶
func AssertModel404NotFoundRequired(obj Model404NotFound) error
AssertModel404NotFoundRequired checks if the required fields are not zero-ed
func AssertModel500InternalErrorRequired ¶
func AssertModel500InternalErrorRequired(obj Model500InternalError) error
AssertModel500InternalErrorRequired checks if the required fields are not zero-ed
func AssertOAuthConfigurationRequired ¶
func AssertOAuthConfigurationRequired(obj OAuthConfiguration) error
AssertOAuthConfigurationRequired checks if the required fields are not zero-ed
func AssertOAuthUserInfoRequired ¶
func AssertOAuthUserInfoRequired(obj OAuthUserInfo) error
AssertOAuthUserInfoRequired checks if the required fields are not zero-ed
func AssertPaginationMetadataRequired ¶
func AssertPaginationMetadataRequired(obj PaginationMetadata) error
AssertPaginationMetadataRequired checks if the required fields are not zero-ed
func AssertPlaylistInfoRequired ¶
func AssertPlaylistInfoRequired(obj PlaylistInfo) error
AssertPlaylistInfoRequired checks if the required fields are not zero-ed
func AssertPlaylistsGet200ResponseRequired ¶
func AssertPlaylistsGet200ResponseRequired(obj PlaylistsGet200Response) error
AssertPlaylistsGet200ResponseRequired checks if the required fields are not zero-ed
func AssertRecurseAuthLoginPostRequestRequired ¶
func AssertRecurseAuthLoginPostRequestRequired(objSlice interface{}) error
AssertRecurseAuthLoginPostRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AuthLoginPostRequest (e.g. [][]AuthLoginPostRequest), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseInterfaceRequired ¶
AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertRecurseLyricsImportStatusRequired ¶
func AssertRecurseLyricsImportStatusRequired(objSlice interface{}) error
AssertRecurseLyricsImportStatusRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LyricsImportStatus (e.g. [][]LyricsImportStatus), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseLyricsRequired ¶
func AssertRecurseLyricsRequired(objSlice interface{}) error
AssertRecurseLyricsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Lyrics (e.g. [][]Lyrics), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseMessageRequired ¶
func AssertRecurseMessageRequired(objSlice interface{}) error
AssertRecurseMessageRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Message (e.g. [][]Message), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseModel401UnauthorizedRequired ¶
func AssertRecurseModel401UnauthorizedRequired(objSlice interface{}) error
AssertRecurseModel401UnauthorizedRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Model401Unauthorized (e.g. [][]Model401Unauthorized), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseModel404NotFoundRequired ¶
func AssertRecurseModel404NotFoundRequired(objSlice interface{}) error
AssertRecurseModel404NotFoundRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Model404NotFound (e.g. [][]Model404NotFound), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseModel500InternalErrorRequired ¶
func AssertRecurseModel500InternalErrorRequired(objSlice interface{}) error
AssertRecurseModel500InternalErrorRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Model500InternalError (e.g. [][]Model500InternalError), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseOAuthConfigurationRequired ¶
func AssertRecurseOAuthConfigurationRequired(objSlice interface{}) error
AssertRecurseOAuthConfigurationRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of OAuthConfiguration (e.g. [][]OAuthConfiguration), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseOAuthUserInfoRequired ¶
func AssertRecurseOAuthUserInfoRequired(objSlice interface{}) error
AssertRecurseOAuthUserInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of OAuthUserInfo (e.g. [][]OAuthUserInfo), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePaginationMetadataRequired ¶
func AssertRecursePaginationMetadataRequired(objSlice interface{}) error
AssertRecursePaginationMetadataRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of PaginationMetadata (e.g. [][]PaginationMetadata), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePlaylistInfoRequired ¶
func AssertRecursePlaylistInfoRequired(objSlice interface{}) error
AssertRecursePlaylistInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of PlaylistInfo (e.g. [][]PlaylistInfo), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePlaylistsGet200ResponseRequired ¶
func AssertRecursePlaylistsGet200ResponseRequired(objSlice interface{}) error
AssertRecursePlaylistsGet200ResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of PlaylistsGet200Response (e.g. [][]PlaylistsGet200Response), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTrackDetailAllOfRequired ¶
func AssertRecurseTrackDetailAllOfRequired(objSlice interface{}) error
AssertRecurseTrackDetailAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TrackDetailAllOf (e.g. [][]TrackDetailAllOf), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTrackDetailRequired ¶
func AssertRecurseTrackDetailRequired(objSlice interface{}) error
AssertRecurseTrackDetailRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TrackDetail (e.g. [][]TrackDetail), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTrackInfoRequired ¶
func AssertRecurseTrackInfoRequired(objSlice interface{}) error
AssertRecurseTrackInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TrackInfo (e.g. [][]TrackInfo), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTracksGet200ResponseRequired ¶
func AssertRecurseTracksGet200ResponseRequired(objSlice interface{}) error
AssertRecurseTracksGet200ResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TracksGet200Response (e.g. [][]TracksGet200Response), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTracksStatsRequired ¶
func AssertRecurseTracksStatsRequired(objSlice interface{}) error
AssertRecurseTracksStatsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TracksStats (e.g. [][]TracksStats), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseUserResponseRequired ¶
func AssertRecurseUserResponseRequired(objSlice interface{}) error
AssertRecurseUserResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UserResponse (e.g. [][]UserResponse), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseValueRequired ¶
AssertRecurseValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertTrackDetailAllOfRequired ¶
func AssertTrackDetailAllOfRequired(obj TrackDetailAllOf) error
AssertTrackDetailAllOfRequired checks if the required fields are not zero-ed
func AssertTrackDetailRequired ¶
func AssertTrackDetailRequired(obj TrackDetail) error
AssertTrackDetailRequired checks if the required fields are not zero-ed
func AssertTrackInfoRequired ¶
AssertTrackInfoRequired checks if the required fields are not zero-ed
func AssertTracksGet200ResponseRequired ¶
func AssertTracksGet200ResponseRequired(obj TracksGet200Response) error
AssertTracksGet200ResponseRequired checks if the required fields are not zero-ed
func AssertTracksStatsRequired ¶
func AssertTracksStatsRequired(obj TracksStats) error
AssertTracksStatsRequired checks if the required fields are not zero-ed
func AssertUserResponseRequired ¶
func AssertUserResponseRequired(obj UserResponse) error
AssertUserResponseRequired checks if the required fields are not zero-ed
func DefaultErrorHandler ¶
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func IsZeroValue ¶
func IsZeroValue(val interface{}) bool
IsZeroValue checks if the val is the zero-ed value.
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type AuthApiController ¶
type AuthApiController struct {
// contains filtered or unexported fields
}
AuthApiController binds http requests to an api service and writes the service results to the http response
func (*AuthApiController) AuthConfigurationGet ¶
func (c *AuthApiController) AuthConfigurationGet(w http.ResponseWriter, r *http.Request)
AuthConfigurationGet - Get configuration for oAuth2 workflow
func (*AuthApiController) AuthLoginPost ¶
func (c *AuthApiController) AuthLoginPost(w http.ResponseWriter, r *http.Request)
AuthLoginPost - Authenticate
func (*AuthApiController) AuthLogoutGet ¶
func (c *AuthApiController) AuthLogoutGet(w http.ResponseWriter, r *http.Request)
AuthLogoutGet - Invalidates the jwt token
func (*AuthApiController) AuthRefreshGet ¶
func (c *AuthApiController) AuthRefreshGet(w http.ResponseWriter, r *http.Request)
AuthRefreshGet - Refresh JWT access token
func (*AuthApiController) Routes ¶
func (c *AuthApiController) Routes() Routes
Routes returns all the api routes for the AuthApiController
type AuthApiOption ¶
type AuthApiOption func(*AuthApiController)
AuthApiOption for how the controller is set up.
func WithAuthApiErrorHandler ¶
func WithAuthApiErrorHandler(h ErrorHandler) AuthApiOption
WithAuthApiErrorHandler inject ErrorHandler into controller
type AuthApiRouter ¶
type AuthApiRouter interface { AuthConfigurationGet(http.ResponseWriter, *http.Request) AuthLoginPost(http.ResponseWriter, *http.Request) AuthLogoutGet(http.ResponseWriter, *http.Request) AuthRefreshGet(http.ResponseWriter, *http.Request) }
AuthApiRouter defines the required methods for binding the api requests to a responses for the AuthApi The AuthApiRouter implementation should parse necessary information from the http request, pass the data to a AuthApiServicer to perform the required actions, then write the service results to the http response.
type AuthApiServicer ¶
type AuthApiServicer interface { AuthConfigurationGet(context.Context) (ImplResponse, error) AuthLoginPost(context.Context, AuthLoginPostRequest) (ImplResponse, error) AuthLogoutGet(context.Context) (ImplResponse, error) AuthRefreshGet(context.Context) (ImplResponse, error) }
AuthApiServicer defines the api actions for the AuthApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type AuthLoginPostRequest ¶
type AuthLoginPostRequest struct {
Code string `json:"code,omitempty"`
}
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler
type ImplResponse ¶
ImplResponse response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
func ResponseWithHeaders ¶
func ResponseWithHeaders(code int, headers map[string][]string, body interface{}) ImplResponse
ResponseWithHeaders return a ImplResponse struct filled, including headers
type ImportApiController ¶
type ImportApiController struct {
// contains filtered or unexported fields
}
ImportApiController binds http requests to an api service and writes the service results to the http response
func (*ImportApiController) ImportLibraryPost ¶
func (c *ImportApiController) ImportLibraryPost(w http.ResponseWriter, r *http.Request)
ImportLibraryPost - Start import of tracks from spotify library
func (*ImportApiController) ImportLyricsGet ¶
func (c *ImportApiController) ImportLyricsGet(w http.ResponseWriter, r *http.Request)
ImportLyricsGet - Get status of import process
func (*ImportApiController) ImportLyricsPost ¶
func (c *ImportApiController) ImportLyricsPost(w http.ResponseWriter, r *http.Request)
ImportLyricsPost - Start import of lyrics
func (*ImportApiController) ImportLyricsTrackIdPost ¶
func (c *ImportApiController) ImportLyricsTrackIdPost(w http.ResponseWriter, r *http.Request)
ImportLyricsTrackIdPost - Try to import lyrics of a specific track
func (*ImportApiController) ImportPlaylistIdPost ¶
func (c *ImportApiController) ImportPlaylistIdPost(w http.ResponseWriter, r *http.Request)
ImportPlaylistIdPost - Start import of tracks from playlist
func (*ImportApiController) Routes ¶
func (c *ImportApiController) Routes() Routes
Routes returns all the api routes for the ImportApiController
type ImportApiOption ¶
type ImportApiOption func(*ImportApiController)
ImportApiOption for how the controller is set up.
func WithImportApiErrorHandler ¶
func WithImportApiErrorHandler(h ErrorHandler) ImportApiOption
WithImportApiErrorHandler inject ErrorHandler into controller
type ImportApiRouter ¶
type ImportApiRouter interface { ImportLibraryPost(http.ResponseWriter, *http.Request) ImportLyricsGet(http.ResponseWriter, *http.Request) ImportLyricsPost(http.ResponseWriter, *http.Request) ImportLyricsTrackIdPost(http.ResponseWriter, *http.Request) ImportPlaylistIdPost(http.ResponseWriter, *http.Request) }
ImportApiRouter defines the required methods for binding the api requests to a responses for the ImportApi The ImportApiRouter implementation should parse necessary information from the http request, pass the data to a ImportApiServicer to perform the required actions, then write the service results to the http response.
type ImportApiServicer ¶
type ImportApiServicer interface { ImportLibraryPost(context.Context) (ImplResponse, error) ImportLyricsGet(context.Context) (ImplResponse, error) ImportLyricsPost(context.Context) (ImplResponse, error) ImportLyricsTrackIdPost(context.Context, string) (ImplResponse, error) ImportPlaylistIdPost(context.Context, string) (ImplResponse, error) }
ImportApiServicer defines the api actions for the ImportApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type LyricsImportStatus ¶
type LyricsImportStatus struct { Running bool `json:"running"` TracksCompleted int32 `json:"tracksCompleted,omitempty"` TracksSuccessful int32 `json:"tracksSuccessful,omitempty"` TracksError int32 `json:"tracksError,omitempty"` TracksTotal int32 `json:"tracksTotal,omitempty"` Log string `json:"log,omitempty"` }
type Model401Unauthorized ¶
type Model401Unauthorized struct {}
type Model404NotFound ¶
type Model500InternalError ¶
type OAuthConfiguration ¶
type OAuthUserInfo ¶
type PaginationMetadata ¶
type ParsingError ¶
type ParsingError struct {
Err error
}
ParsingError indicates that an error has occurred when parsing request parameters
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
func (*ParsingError) Unwrap ¶
func (e *ParsingError) Unwrap() error
type PlaylistInfo ¶
type PlaylistInfo struct { SpotifyId string `json:"spotifyId,omitempty"` Name string `json:"name,omitempty"` CoverImage string `json:"coverImage,omitempty"` TrackCount int32 `json:"trackCount,omitempty"` Owner string `json:"owner,omitempty"` IsPublic bool `json:"isPublic,omitempty"` IsCollaborative bool `json:"isCollaborative,omitempty"` }
type PlaylistsApiController ¶
type PlaylistsApiController struct {
// contains filtered or unexported fields
}
PlaylistsApiController binds http requests to an api service and writes the service results to the http response
func (*PlaylistsApiController) PlaylistsGet ¶
func (c *PlaylistsApiController) PlaylistsGet(w http.ResponseWriter, r *http.Request)
PlaylistsGet - Returns a list of your saved playlists
func (*PlaylistsApiController) Routes ¶
func (c *PlaylistsApiController) Routes() Routes
Routes returns all the api routes for the PlaylistsApiController
type PlaylistsApiOption ¶
type PlaylistsApiOption func(*PlaylistsApiController)
PlaylistsApiOption for how the controller is set up.
func WithPlaylistsApiErrorHandler ¶
func WithPlaylistsApiErrorHandler(h ErrorHandler) PlaylistsApiOption
WithPlaylistsApiErrorHandler inject ErrorHandler into controller
type PlaylistsApiRouter ¶
type PlaylistsApiRouter interface {
PlaylistsGet(http.ResponseWriter, *http.Request)
}
PlaylistsApiRouter defines the required methods for binding the api requests to a responses for the PlaylistsApi The PlaylistsApiRouter implementation should parse necessary information from the http request, pass the data to a PlaylistsApiServicer to perform the required actions, then write the service results to the http response.
type PlaylistsApiServicer ¶
type PlaylistsApiServicer interface {
PlaylistsGet(context.Context, int32, int32) (ImplResponse, error)
}
PlaylistsApiServicer defines the api actions for the PlaylistsApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type PlaylistsGet200Response ¶
type PlaylistsGet200Response struct { Meta PaginationMetadata `json:"meta,omitempty"` Data []PlaylistInfo `json:"data,omitempty"` }
type RequiredError ¶
type RequiredError struct {
Field string
}
RequiredError indicates that an error has occurred when parsing request parameters
func (*RequiredError) Error ¶
func (e *RequiredError) Error() string
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewAuthApiController ¶
func NewAuthApiController(s AuthApiServicer, opts ...AuthApiOption) Router
NewAuthApiController creates a default api controller
func NewImportApiController ¶
func NewImportApiController(s ImportApiServicer, opts ...ImportApiOption) Router
NewImportApiController creates a default api controller
func NewPlaylistsApiController ¶
func NewPlaylistsApiController(s PlaylistsApiServicer, opts ...PlaylistsApiOption) Router
NewPlaylistsApiController creates a default api controller
func NewTracksApiController ¶
func NewTracksApiController(s TracksApiServicer, opts ...TracksApiOption) Router
NewTracksApiController creates a default api controller
type TrackDetail ¶
type TrackDetail struct { SpotifyId string `json:"spotifyId"` Title string `json:"title"` Album string `json:"album,omitempty"` CoverImage string `json:"coverImage,omitempty"` PreviewURL string `json:"previewURL,omitempty"` Artists []string `json:"artists,omitempty"` HasLyrics bool `json:"hasLyrics"` Language string `json:"language,omitempty"` Lyrics string `json:"lyrics"` LyricsImportErrorCount int32 `json:"lyricsImportErrorCount"` }
type TrackDetailAllOf ¶
type TrackInfo ¶
type TrackInfo struct { SpotifyId string `json:"spotifyId"` Title string `json:"title"` Album string `json:"album,omitempty"` CoverImage string `json:"coverImage,omitempty"` PreviewURL string `json:"previewURL,omitempty"` Artists []string `json:"artists,omitempty"` HasLyrics bool `json:"hasLyrics"` Language string `json:"language,omitempty"` }
type TracksApiController ¶
type TracksApiController struct {
// contains filtered or unexported fields
}
TracksApiController binds http requests to an api service and writes the service results to the http response
func (*TracksApiController) Routes ¶
func (c *TracksApiController) Routes() Routes
Routes returns all the api routes for the TracksApiController
func (*TracksApiController) TracksGet ¶
func (c *TracksApiController) TracksGet(w http.ResponseWriter, r *http.Request)
TracksGet - Returns a list of tracks
func (*TracksApiController) TracksIdGet ¶
func (c *TracksApiController) TracksIdGet(w http.ResponseWriter, r *http.Request)
TracksIdGet - Returns a track
func (*TracksApiController) TracksIdPatch ¶
func (c *TracksApiController) TracksIdPatch(w http.ResponseWriter, r *http.Request)
TracksIdPatch - Updates lyrics of a track
func (*TracksApiController) TracksStatsGet ¶
func (c *TracksApiController) TracksStatsGet(w http.ResponseWriter, r *http.Request)
TracksStatsGet - Returns stats about your index
type TracksApiOption ¶
type TracksApiOption func(*TracksApiController)
TracksApiOption for how the controller is set up.
func WithTracksApiErrorHandler ¶
func WithTracksApiErrorHandler(h ErrorHandler) TracksApiOption
WithTracksApiErrorHandler inject ErrorHandler into controller
type TracksApiRouter ¶
type TracksApiRouter interface { TracksGet(http.ResponseWriter, *http.Request) TracksIdGet(http.ResponseWriter, *http.Request) TracksIdPatch(http.ResponseWriter, *http.Request) TracksStatsGet(http.ResponseWriter, *http.Request) }
TracksApiRouter defines the required methods for binding the api requests to a responses for the TracksApi The TracksApiRouter implementation should parse necessary information from the http request, pass the data to a TracksApiServicer to perform the required actions, then write the service results to the http response.
type TracksApiServicer ¶
type TracksApiServicer interface { TracksGet(context.Context, int32, int32, string) (ImplResponse, error) TracksIdGet(context.Context, string) (ImplResponse, error) TracksIdPatch(context.Context, string, Lyrics) (ImplResponse, error) TracksStatsGet(context.Context) (ImplResponse, error) }
TracksApiServicer defines the api actions for the TracksApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type TracksGet200Response ¶
type TracksGet200Response struct { Meta PaginationMetadata `json:"meta"` Data []TrackInfo `json:"data"` }
type TracksStats ¶
type UserResponse ¶
Source Files
¶
- api.go
- api_auth.go
- api_import.go
- api_playlists.go
- api_tracks.go
- error.go
- helpers.go
- impl.go
- logger.go
- model_401_unauthorized.go
- model_404_not_found.go
- model_500_internal_error.go
- model__auth_login_post_request.go
- model__playlists_get_200_response.go
- model__tracks_get_200_response.go
- model_lyrics.go
- model_lyrics_import_status.go
- model_message.go
- model_o_auth_configuration.go
- model_o_auth_user_info.go
- model_pagination_metadata.go
- model_playlist_info.go
- model_track_detail.go
- model_track_detail_all_of.go
- model_track_info.go
- model_tracks_stats.go
- model_user_response.go
- routers.go