Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- 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 AddLink
- type AddLinkJSONRequestBody
- type AddLinkRequest
- type AddSitemap200Response
- type AddSitemapJSONRequestBody
- type AddSitemapRequest
- type ChiServerOptions
- type ErrorResponse
- type GetLinks200Response
- type GetLinksParams
- type InvalidParamFormatError
- type Link
- type LinkFilter
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddLink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) AddSitemap(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteLink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLinks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateLinks(w http.ResponseWriter, r *http.Request)
- type SitemapRequest
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) AddLink(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) AddSitemap(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteLink(w http.ResponseWriter, r *http.Request, hash string)
- func (_ Unimplemented) GetLink(w http.ResponseWriter, r *http.Request, hash string)
- func (_ Unimplemented) GetLinks(w http.ResponseWriter, r *http.Request, params GetLinksParams)
- func (_ Unimplemented) UpdateLinks(w http.ResponseWriter, r *http.Request)
- type UnmarshalingParamError
- type UpdateLinkRequest
- type UpdateLinks200Response
- type UpdateLinksJSONRequestBody
- type UpdateLinksRequest
Constants ¶
This section is empty.
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 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 AddLink ¶
type AddLink struct { // Describe Description of the link. Describe *string `json:"describe,omitempty"` // Url The URL of the link. Url string `json:"url"` }
AddLink defines model for AddLink.
type AddLinkJSONRequestBody ¶
type AddLinkJSONRequestBody = AddLink
AddLinkJSONRequestBody defines body for AddLink for application/json ContentType.
type AddLinkRequest ¶
type AddLinkRequest = AddLink
AddLinkRequest defines model for AddLinkRequest.
type AddSitemap200Response ¶
type AddSitemap200Response struct { // Message A confirmation message. Message *string `json:"message,omitempty"` }
AddSitemap200Response defines model for addSitemap_200_response.
type AddSitemapJSONRequestBody ¶
type AddSitemapJSONRequestBody = AddSitemapRequest
AddSitemapJSONRequestBody defines body for AddSitemap for application/json ContentType.
type AddSitemapRequest ¶
type AddSitemapRequest struct { // Url The URL of the sitemap. Url string `json:"url"` }
AddSitemapRequest defines model for addSitemap_request.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type ErrorResponse ¶
type ErrorResponse struct { // Messages An array of human-readable messages providing more details about the error. Messages *[]string `json:"messages,omitempty"` }
ErrorResponse defines model for ErrorResponse.
type GetLinks200Response ¶
type GetLinks200Response struct { Links []Link `json:"links"` // NextCursor A cursor to be used to fetch the next page of results. NextCursor string `json:"next_cursor"` }
GetLinks200Response defines model for getLinks_200_response.
type GetLinksParams ¶
type GetLinksParams struct { // Limit The number of items to return per page. Limit *int `form:"limit,omitempty" json:"limit,omitempty"` // Cursor A cursor for use in pagination. This is the ID of the last item in the previous page. Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` Filter *LinkFilter `form:"filter,omitempty" json:"filter,omitempty"` }
GetLinksParams defines parameters for GetLinks.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Link ¶
type Link struct { // CreatedAt Timestamp when the link was created. CreatedAt time.Time `json:"created_at"` // Describe Description of the link. Describe string `json:"describe"` // Hash Unique hash, used as the short link. Hash string `json:"hash"` // UpdatedAt Timestamp when the link was last updated. UpdatedAt time.Time `json:"updated_at"` // Url The URL of the link. Url string `json:"url"` }
Link defines model for Link.
type LinkFilter ¶
type LinkFilter struct { // Id Unique identifier of the link. Use this to update a specific link. Id *openapi_types.UUID `json:"id,omitempty"` // UrlContains Filter links that contain this text in their URL. UrlContains *string `json:"urlContains,omitempty"` }
LinkFilter defines model for LinkFilter.
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 { // List links // (GET /links) GetLinks(w http.ResponseWriter, r *http.Request, params GetLinksParams) // Add link // (POST /links) AddLink(w http.ResponseWriter, r *http.Request) // Update links // (PUT /links) UpdateLinks(w http.ResponseWriter, r *http.Request) // Delete link // (DELETE /links/{hash}) DeleteLink(w http.ResponseWriter, r *http.Request, hash string) // Get link // (GET /links/{hash}) GetLink(w http.ResponseWriter, r *http.Request, hash string) // Add Sitemap // (POST /sitemap) AddSitemap(w http.ResponseWriter, r *http.Request) }
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) AddLink ¶
func (siw *ServerInterfaceWrapper) AddLink(w http.ResponseWriter, r *http.Request)
AddLink operation middleware
func (*ServerInterfaceWrapper) AddSitemap ¶
func (siw *ServerInterfaceWrapper) AddSitemap(w http.ResponseWriter, r *http.Request)
AddSitemap operation middleware
func (*ServerInterfaceWrapper) DeleteLink ¶
func (siw *ServerInterfaceWrapper) DeleteLink(w http.ResponseWriter, r *http.Request)
DeleteLink operation middleware
func (*ServerInterfaceWrapper) GetLink ¶
func (siw *ServerInterfaceWrapper) GetLink(w http.ResponseWriter, r *http.Request)
GetLink operation middleware
func (*ServerInterfaceWrapper) GetLinks ¶
func (siw *ServerInterfaceWrapper) GetLinks(w http.ResponseWriter, r *http.Request)
GetLinks operation middleware
func (*ServerInterfaceWrapper) UpdateLinks ¶
func (siw *ServerInterfaceWrapper) UpdateLinks(w http.ResponseWriter, r *http.Request)
UpdateLinks operation middleware
type SitemapRequest ¶
type SitemapRequest = AddSitemapRequest
SitemapRequest defines model for SitemapRequest.
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 Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) AddLink ¶
func (_ Unimplemented) AddLink(w http.ResponseWriter, r *http.Request)
Add link (POST /links)
func (Unimplemented) AddSitemap ¶
func (_ Unimplemented) AddSitemap(w http.ResponseWriter, r *http.Request)
Add Sitemap (POST /sitemap)
func (Unimplemented) DeleteLink ¶
func (_ Unimplemented) DeleteLink(w http.ResponseWriter, r *http.Request, hash string)
Delete link (DELETE /links/{hash})
func (Unimplemented) GetLink ¶
func (_ Unimplemented) GetLink(w http.ResponseWriter, r *http.Request, hash string)
Get link (GET /links/{hash})
func (Unimplemented) GetLinks ¶
func (_ Unimplemented) GetLinks(w http.ResponseWriter, r *http.Request, params GetLinksParams)
List links (GET /links)
func (Unimplemented) UpdateLinks ¶
func (_ Unimplemented) UpdateLinks(w http.ResponseWriter, r *http.Request)
Update links (PUT /links)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateLinkRequest ¶
type UpdateLinkRequest = UpdateLinksRequest
UpdateLinkRequest defines model for UpdateLinkRequest.
type UpdateLinks200Response ¶
type UpdateLinks200Response struct { // UpdatedCount The number of links updated. UpdatedCount *int `json:"updatedCount,omitempty"` }
UpdateLinks200Response defines model for updateLinks_200_response.
type UpdateLinksJSONRequestBody ¶
type UpdateLinksJSONRequestBody = UpdateLinksRequest
UpdateLinksJSONRequestBody defines body for UpdateLinks for application/json ContentType.
type UpdateLinksRequest ¶
type UpdateLinksRequest struct { Filter *LinkFilter `json:"filter,omitempty"` Link *Link `json:"link,omitempty"` }
UpdateLinksRequest defines model for updateLinks_request.