api

package
v0.0.0-...-795bb3f Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type TranslationsCount

type TranslationsCount struct {
	Iso               *string `json:"iso,omitempty"`
	TotalTranslations *int64  `json:"totalTranslations,omitempty"`
}

TranslationsCount defines model for TranslationsCount.

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

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

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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