Documentation
¶
Overview ¶
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.9.1 DO NOT EDIT.
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.9.1 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type CreateShortUrlJSONBody
- type CreateShortUrlJSONRequestBody
- type Error
- type GinServerOptions
- type HttpServer
- type MiddlewareFunc
- type PostShortUrl
- type ServerInterface
- type ServerInterfaceWrapper
- type ShortUrl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type CreateShortUrlJSONBody ¶
type CreateShortUrlJSONBody PostShortUrl
CreateShortUrlJSONBody defines parameters for CreateShortUrl.
type CreateShortUrlJSONRequestBody ¶
type CreateShortUrlJSONRequestBody CreateShortUrlJSONBody
CreateShortUrlJSONRequestBody defines body for CreateShortUrl for application/json ContentType.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc }
GinServerOptions provides options for the Gin server.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(service app.ShortUrlService) *HttpServer
func (HttpServer) CreateShortUrl ¶
func (h HttpServer) CreateShortUrl(c *gin.Context)
func (HttpServer) RedirectToOriginUrl ¶
func (h HttpServer) RedirectToOriginUrl(c *gin.Context, urlId string)
type MiddlewareFunc ¶
type PostShortUrl ¶
PostShortUrl defines model for PostShortUrl.
type ServerInterface ¶
type ServerInterface interface { // (POST /api/v1/urls) CreateShortUrl(c *gin.Context) // (GET /{urlId}) RedirectToOriginUrl(c *gin.Context, urlId string) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateShortUrl ¶
func (siw *ServerInterfaceWrapper) CreateShortUrl(c *gin.Context)
CreateShortUrl operation middleware
func (*ServerInterfaceWrapper) RedirectToOriginUrl ¶
func (siw *ServerInterfaceWrapper) RedirectToOriginUrl(c *gin.Context)
RedirectToOriginUrl operation middleware