Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
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 Error
- type InvalidParamFormatError
- type Language
- type LanguageDataCount
- type LatestUpdateTime
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetLanguage(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLanguageDataCount(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLatestUpdateTime(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListLanguages(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type TranslationsCount
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GetLanguage(w http.ResponseWriter, r *http.Request, iso string)
- func (_ Unimplemented) GetLanguageDataCount(w http.ResponseWriter, r *http.Request, iso string)
- func (_ Unimplemented) GetLatestUpdateTime(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListLanguages(w http.ResponseWriter, r *http.Request)
- 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 Error ¶
type Error struct {
Message *string `json:"message,omitempty"`
}
Error defines model for Error.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Language ¶
type Language struct { Iso *string `json:"iso,omitempty"` Name *string `json:"name,omitempty"` WikidataId *string `json:"wikidataId,omitempty"` }
Language defines model for Language.
type LanguageDataCount ¶
type LanguageDataCount struct { TotalEmojiKeywords *int64 `json:"totalEmojiKeywords,omitempty"` TotalNouns *int64 `json:"totalNouns,omitempty"` TotalPrepositions *int64 `json:"totalPrepositions,omitempty"` TotalVerbs *int64 `json:"totalVerbs,omitempty"` Translations *[]TranslationsCount `json:"translations,omitempty"` }
LanguageDataCount defines model for LanguageDataCount.
type LatestUpdateTime ¶
type LatestUpdateTime struct {
UpdateTime *string `json:"updateTime,omitempty"`
}
LatestUpdateTime defines model for LatestUpdateTime.
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 /languages) ListLanguages(w http.ResponseWriter, r *http.Request) // (GET /languages/{iso}) GetLanguage(w http.ResponseWriter, r *http.Request, iso string) // (GET /languages/{iso}/count) GetLanguageDataCount(w http.ResponseWriter, r *http.Request, iso string) // (GET /latest) GetLatestUpdateTime(w http.ResponseWriter, r *http.Request) }
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) GetLanguage ¶
func (siw *ServerInterfaceWrapper) GetLanguage(w http.ResponseWriter, r *http.Request)
GetLanguage operation middleware
func (*ServerInterfaceWrapper) GetLanguageDataCount ¶
func (siw *ServerInterfaceWrapper) GetLanguageDataCount(w http.ResponseWriter, r *http.Request)
GetLanguageDataCount operation middleware
func (*ServerInterfaceWrapper) GetLatestUpdateTime ¶
func (siw *ServerInterfaceWrapper) GetLatestUpdateTime(w http.ResponseWriter, r *http.Request)
GetLatestUpdateTime operation middleware
func (*ServerInterfaceWrapper) ListLanguages ¶
func (siw *ServerInterfaceWrapper) ListLanguages(w http.ResponseWriter, r *http.Request)
ListLanguages operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type TranslationsCount ¶
type TranslationsCount struct { Iso *string `json:"iso,omitempty"` TotalTranslations *int64 `json:"totalTranslations,omitempty"` }
TranslationsCount defines model for TranslationsCount.
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) GetLanguage ¶
func (_ Unimplemented) GetLanguage(w http.ResponseWriter, r *http.Request, iso string)
(GET /languages/{iso})
func (Unimplemented) GetLanguageDataCount ¶
func (_ Unimplemented) GetLanguageDataCount(w http.ResponseWriter, r *http.Request, iso string)
(GET /languages/{iso}/count)
func (Unimplemented) GetLatestUpdateTime ¶
func (_ Unimplemented) GetLatestUpdateTime(w http.ResponseWriter, r *http.Request)
(GET /latest)
func (Unimplemented) ListLanguages ¶
func (_ Unimplemented) ListLanguages(w http.ResponseWriter, r *http.Request)
(GET /languages)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error