Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.3 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 Error
- type GetGroupParams
- type GetGroupResponse
- type GetTokenDataParams
- type GetTokenResponse
- type Group
- type Healthcheck
- type HealthcheckResponse
- type InternalErrorResponse
- type MiddlewareFunc
- type NotFoundErrorResponse
- type Options
- type Question
- type Questions
- 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
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 }
type GetGroupParams ¶
type GetGroupParams struct {
Token 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 `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"` 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 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 SaveGroupJSONRequestBody ¶
type SaveGroupJSONRequestBody SaveGroupRequest
SaveGroupJSONRequestBody defines body for SaveGroup for application/json ContentType.
type SaveGroupParams ¶
type SaveGroupParams struct {
Token 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 // (GET /group) GetGroup(w http.ResponseWriter, r *http.Request, params GetGroupParams) // Save group // (POST /group) SaveGroup(w http.ResponseWriter, r *http.Request, params SaveGroupParams) // Healthcheck // (GET /healthcheck) Healthcheck(w http.ResponseWriter, r *http.Request) // Get token data // (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 }
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