Documentation
¶
Overview ¶
Package rest provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Package rest provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Index ¶
- Constants
- 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
- type ChiServerOptions
- type ErrorResp
- type HttpServer
- type MiddlewareFunc
- type RegisterJSONBody
- type RegisterJSONRequestBody
- type RegisterReqBody
- type ServerInterface
- type ServerInterfaceWrapper
- type SuccessResp
Constants ¶
const (
BasicAuthScopes = "basicAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
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 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
}
type ErrorResp ¶
type ErrorResp struct {
HttpStatus int `json:"http_status"`
Message *string `json:"message,omitempty"`
Name string `json:"name"`
}
ErrorResp defines model for ErrorResp.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(app app.App) HttpServer
func (HttpServer) Register ¶
func (h HttpServer) Register(w http.ResponseWriter, r *http.Request)
(POST /register)
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type RegisterJSONBody ¶
type RegisterJSONBody RegisterReqBody
RegisterJSONBody defines parameters for Register.
type RegisterJSONRequestBody ¶
type RegisterJSONRequestBody RegisterJSONBody
RegisterJSONRequestBody defines body for Register for application/json ContentType.
type RegisterReqBody ¶
type RegisterReqBody struct {
TelegramId int64 `json:"telegramId"`
}
RegisterReqBody defines model for RegisterReqBody.
type ServerInterface ¶
type ServerInterface interface {
// (POST /register)
Register(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) Register ¶
func (siw *ServerInterfaceWrapper) Register(w http.ResponseWriter, r *http.Request)
Register operation middleware
type SuccessResp ¶
type SuccessResp struct {
Success bool `json:"success"`
}
SuccessResp defines model for SuccessResp.