Documentation ¶
Overview ¶
Package coffee provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package coffee provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 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 ListAllCharacteristic() []string
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type BestCoffees
- type Characteristic
- type ChiServerOptions
- type Error
- type Filter
- type GetBestTypeCoffeeParams
- type InvalidParamFormatError
- type MiddlewareFunc
- type Option
- type OptionProvider
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type Service
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
- type UseCase
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
func ListAllCharacteristic ¶
func ListAllCharacteristic() []string
Types ¶
type BestCoffees ¶
type BestCoffees struct { Characteristics []Characteristic `json:"characteristics"` ChatGpt []Option `json:"chat_gpt"` Database *[]Option `json:"database,omitempty"` }
BestCoffees defines model for BestCoffees.
type Characteristic ¶
type Characteristic string
Characteristic defines model for Characteristic.
const ( Acidity Characteristic = "acidity" Aftertaste Characteristic = "aftertaste" Aroma Characteristic = "aroma" Body Characteristic = "body" Flavor Characteristic = "flavor" Sweetness Characteristic = "sweetness" )
Defines values for Characteristic.
func ConvertToCharacteristic ¶
func ConvertToCharacteristic(strs []string) []Characteristic
func (Characteristic) IsValid ¶
func (c Characteristic) IsValid() bool
func (Characteristic) String ¶
func (c Characteristic) String() string
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Filter ¶
type Filter struct { Characteristics []Characteristic Limit int Sort bool // 0 = desc - 1 = asc }
type GetBestTypeCoffeeParams ¶
type GetBestTypeCoffeeParams struct { // Characteristics Characteristics to build your best type of coffee, up to 3 selected characteristics. Characteristics []Characteristic `form:"characteristics" json:"characteristics"` }
GetBestTypeCoffeeParams defines parameters for GetBestTypeCoffee.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Option ¶
type Option struct { Details *map[string]interface{} `json:"details,omitempty"` Message string `json:"message"` }
Option defines model for Option.
type OptionProvider ¶
type OptionProvider struct { Message string Details interface{} }
OptionProvider mean a selected option coffee
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 the right type of coffee // (GET /v1/best-coffees) GetBestTypeCoffee(w http.ResponseWriter, r *http.Request, params GetBestTypeCoffeeParams) }
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) GetBestTypeCoffee ¶
func (siw *ServerInterfaceWrapper) GetBestTypeCoffee(w http.ResponseWriter, r *http.Request)
GetBestTypeCoffee operation middleware
type Service ¶
type Service interface {
GetCoffeeOptionsByCharacteristics(context.Context, Filter) ([]OptionProvider, error)
}
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 UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error