Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.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 API
- func (hdl *API) GetGroup(w http.ResponseWriter, r *http.Request, params GetGroupParams)
- func (hdl *API) GetHTTPRouter() *chi.Mux
- func (hdl *API) GetTokenData(w http.ResponseWriter, r *http.Request, params GetTokenDataParams)
- func (hdl *API) Healthcheck(w http.ResponseWriter, r *http.Request)
- func (hdl *API) SaveGroup(w http.ResponseWriter, r *http.Request, params SaveGroupParams)
- type Answer
- type Answers
- type ChiServerOptions
- type Domain
- type Domains
- type Error
- type GetGroupParams
- type GetGroupResponse
- type GetTokenDataParams
- type GetTokenResponse
- type Group
- type Healthcheck
- type HealthcheckResponse
- type InternalErrorResponse
- type InvalidParamFormatError
- type MiddlewareFunc
- type NotFoundErrorResponse
- type Options
- type Question
- type Questions
- type RequiredHeaderError
- type RequiredParamError
- type SaveGroupJSONRequestBody
- type SaveGroupParams
- type SaveGroupRequest
- type SaveGroupResponse
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetGroup(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTokenData(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Healthcheck(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SaveGroup(w http.ResponseWriter, r *http.Request)
- type Token
- type TokenData
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- 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 API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetGroup ¶
func (hdl *API) GetGroup(w http.ResponseWriter, r *http.Request, params GetGroupParams)
func (*API) GetHTTPRouter ¶
func (hdl *API) GetHTTPRouter() *chi.Mux
func (*API) GetTokenData ¶
func (hdl *API) GetTokenData(w http.ResponseWriter, r *http.Request, params GetTokenDataParams)
func (*API) Healthcheck ¶
func (hdl *API) Healthcheck(w http.ResponseWriter, r *http.Request)
func (*API) SaveGroup ¶
func (hdl *API) SaveGroup(w http.ResponseWriter, r *http.Request, params SaveGroupParams)
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type GetGroupParams ¶
type GetGroupParams struct {
Token Token `form:"token" json:"token"`
}
GetGroupParams defines parameters for GetGroup.
type GetGroupResponse ¶
type GetGroupResponse = Group
GetGroupResponse defines model for GetGroupResponse.
type GetTokenDataParams ¶
type GetTokenDataParams struct {
Token Token `form:"token" json:"token"`
}
GetTokenDataParams defines parameters for GetTokenData.
type GetTokenResponse ¶
type GetTokenResponse = TokenData
GetTokenResponse defines model for GetTokenResponse.
type Group ¶
type Group struct { BanQuestion bool `json:"ban_question"` BanTimeout int32 `json:"ban_timeout"` BanUrl bool `json:"ban_url"` Greeting string `json:"greeting"` Id int64 `json:"id"` IgnoreDomains *Domains `json:"ignore_domains,omitempty"` Questions Questions `json:"questions"` }
Group defines model for Group.
type Healthcheck ¶
type Healthcheck = map[string]interface{}
Healthcheck defines model for Healthcheck.
type HealthcheckResponse ¶
type HealthcheckResponse = Healthcheck
HealthcheckResponse defines model for HealthcheckResponse.
type InternalErrorResponse ¶
type InternalErrorResponse = Error
InternalErrorResponse defines model for InternalErrorResponse.
type InvalidParamFormatError ¶ added in v1.5.0
func (*InvalidParamFormatError) Error ¶ added in v1.5.0
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶ added in v1.5.0
func (e *InvalidParamFormatError) Unwrap() error
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type NotFoundErrorResponse ¶
type NotFoundErrorResponse = Error
NotFoundErrorResponse defines model for NotFoundErrorResponse.
type Options ¶
type Options struct { Log *zap.SugaredLogger Model *model.Model Storage *storage.InstanceObj }
type RequiredHeaderError ¶ added in v1.5.0
func (*RequiredHeaderError) Error ¶ added in v1.5.0
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶ added in v1.5.0
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶ added in v1.5.0
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶ added in v1.5.0
func (e *RequiredParamError) Error() string
type SaveGroupJSONRequestBody ¶
type SaveGroupJSONRequestBody = SaveGroupRequest
SaveGroupJSONRequestBody defines body for SaveGroup for application/json ContentType.
type SaveGroupParams ¶
type SaveGroupParams struct {
Token Token `form:"token" json:"token"`
}
SaveGroupParams defines parameters for SaveGroup.
type SaveGroupRequest ¶
type SaveGroupRequest = Group
SaveGroupRequest defines model for SaveGroupRequest.
type SaveGroupResponse ¶
type SaveGroupResponse = map[string]interface{}
SaveGroupResponse defines model for SaveGroupResponse.
type ServerInterface ¶
type ServerInterface interface { // (GET /group) GetGroup(w http.ResponseWriter, r *http.Request, params GetGroupParams) // (POST /group) SaveGroup(w http.ResponseWriter, r *http.Request, params SaveGroupParams) // (GET /healthcheck) Healthcheck(w http.ResponseWriter, r *http.Request) // (GET /token) GetTokenData(w http.ResponseWriter, r *http.Request, params GetTokenDataParams) }
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) GetGroup ¶
func (siw *ServerInterfaceWrapper) GetGroup(w http.ResponseWriter, r *http.Request)
GetGroup operation middleware
func (*ServerInterfaceWrapper) GetTokenData ¶
func (siw *ServerInterfaceWrapper) GetTokenData(w http.ResponseWriter, r *http.Request)
GetTokenData operation middleware
func (*ServerInterfaceWrapper) Healthcheck ¶
func (siw *ServerInterfaceWrapper) Healthcheck(w http.ResponseWriter, r *http.Request)
Healthcheck operation middleware
func (*ServerInterfaceWrapper) SaveGroup ¶
func (siw *ServerInterfaceWrapper) SaveGroup(w http.ResponseWriter, r *http.Request)
SaveGroup operation middleware
type TokenData ¶
type TokenData struct {
Ttl string `json:"ttl"`
}
TokenData defines model for TokenData.
type TooManyValuesForParamError ¶ added in v1.5.0
func (*TooManyValuesForParamError) Error ¶ added in v1.5.0
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶ added in v1.5.0
func (*UnescapedCookieParamError) Error ¶ added in v1.5.0
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶ added in v1.5.0
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶ added in v1.5.0
func (*UnmarshalingParamError) Error ¶ added in v1.5.0
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶ added in v1.5.0
func (e *UnmarshalingParamError) Unwrap() error