apis

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeArtistNotFound api.ErrorType = "ARTIST_NOT_FOUND"
	ErrTypeAlbumNotFound  api.ErrorType = "ALBUM_NOT_FOUND"
	ErrTypeTrackNotFound  api.ErrorType = "TRACK_NOT_FOUND"
	ErrTypeRouteNotFound  api.ErrorType = "ROUTE_NOT_FOUND"
	ErrTypeInvalidFilter  api.ErrorType = "INVALID_FILTER"
	ErrTypeInvalidSort    api.ErrorType = "INVALID_SORT"
)
View Source
const ErrTypeUnknownError api.ErrorType = "UNKNOWN_ERROR"

Variables

This section is empty.

Functions

func AlbumNotFound added in v0.15.0

func AlbumNotFound() *api.Error

func ArtistNotFound added in v0.15.0

func ArtistNotFound() *api.Error

func Body

func Body[T types.Body](c echo.Context) (T, error)

func ConvertDBTrack added in v0.15.4

func ConvertDBTrack(c echo.Context, track database.Track) types.Track

func InstallAlbumHandlers

func InstallAlbumHandlers(app core.App, group Group)

func InstallArtistHandlers

func InstallArtistHandlers(app core.App, group Group)

func InstallAuthHandlers

func InstallAuthHandlers(app core.App, group Group)

func InstallHandlers

func InstallHandlers(app core.App, g Group)

func InstallPlaylistHandlers

func InstallPlaylistHandlers(app core.App, group Group)

func InstallQueueHandlers

func InstallQueueHandlers(app core.App, group Group)

func InstallSyncHandlers

func InstallSyncHandlers(app core.App, group Group)

func InstallSystemHandlers

func InstallSystemHandlers(app core.App, group Group)

func InstallTagHandlers

func InstallTagHandlers(app core.App, group Group)

func InstallTrackHandlers

func InstallTrackHandlers(app core.App, group Group)

func InvalidFilter added in v0.15.0

func InvalidFilter(err error) *api.Error

func InvalidSort added in v0.15.2

func InvalidSort(err error) *api.Error

func ParseQueryBool added in v0.15.4

func ParseQueryBool(s string) bool

func RouteNotFound added in v0.15.0

func RouteNotFound() *api.Error

func Server

func Server(app core.App) (*echo.Echo, error)

func SuccessResponse added in v0.15.0

func SuccessResponse(data any) api.Response

func TrackNotFound added in v0.15.0

func TrackNotFound() *api.Error

func User

func User(app core.App, c echo.Context) (*database.User, error)

Types

type Group

type Group interface {
	Register(handlers ...Handler)
}

type Handler

type Handler struct {
	Name        string
	Method      string
	Path        string
	DataType    any
	BodyType    types.Body
	Errors      []api.ErrorType
	HandlerFunc echo.HandlerFunc
	Middlewares []echo.MiddlewareFunc
}

Jump to

Keyboard shortcuts

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