Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Package api provides bindings to interact with the anilistarr API.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type CustomList
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type Service
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type CustomList ¶
type CustomList = []struct { TvdbID *float32 `json:"TvdbID,omitempty"` }
CustomList defines model for CustomList.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface { // (GET /user/{name}/id) GetUserID(w http.ResponseWriter, r *http.Request, name string) // (GET /user/{name}/media) GetUserMedia(w http.ResponseWriter, r *http.Request, name string) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetUserID ¶
func (siw *ServerInterfaceWrapper) GetUserID(w http.ResponseWriter, r *http.Request)
GetUserID operation middleware
func (*ServerInterfaceWrapper) GetUserMedia ¶
func (siw *ServerInterfaceWrapper) GetUserMedia(w http.ResponseWriter, r *http.Request)
GetUserMedia operation middleware
type Service ¶ added in v0.3.0
type Service struct { Unimplemented MediaLister usecases.MediaLister }
Service implements handlers to serve media lister as a REST API.
func (*Service) GetUserID ¶ added in v0.3.0
GetUserID retrieves an user ID for a given name. Responds with:
- 200 + plain-text ID + headers on success
- 404 if media lister cannot find the user
- 500 for any other errors
func (*Service) GetUserMedia ¶ added in v0.3.0
GetUserMedia retrieves media information from an user. Returns 200 on success with a marshaled [entities.CustomList] as JSON or a 502 otherwise.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GetUserID ¶
func (_ Unimplemented) GetUserID(w http.ResponseWriter, r *http.Request, name string)
(GET /user/{name}/id)
func (Unimplemented) GetUserMedia ¶
func (_ Unimplemented) GetUserMedia(w http.ResponseWriter, r *http.Request, name string)
(GET /user/{name}/media)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error