Documentation
¶
Index ¶
- Constants
- type CreateURL
- type CreateURLCreated
- type CreateURLHandler
- type CreateURLHandlerFunc
- type CreateURLInternalServerError
- type CreateURLParams
- type CreateURLURL
- func (o *CreateURLURL) Build() (*url.URL, error)
- func (o *CreateURLURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *CreateURLURL) Must(u *url.URL, err error) *url.URL
- func (o *CreateURLURL) SetBasePath(bp string)
- func (o *CreateURLURL) String() string
- func (o *CreateURLURL) StringFull(scheme, host string) string
- func (o *CreateURLURL) WithBasePath(bp string) *CreateURLURL
- type DeleteURL
- type DeleteURLBadRequest
- type DeleteURLHandler
- type DeleteURLHandlerFunc
- type DeleteURLInternalServerError
- type DeleteURLNoContent
- type DeleteURLParams
- type DeleteURLURL
- func (o *DeleteURLURL) Build() (*url.URL, error)
- func (o *DeleteURLURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *DeleteURLURL) Must(u *url.URL, err error) *url.URL
- func (o *DeleteURLURL) SetBasePath(bp string)
- func (o *DeleteURLURL) String() string
- func (o *DeleteURLURL) StringFull(scheme, host string) string
- func (o *DeleteURLURL) WithBasePath(bp string) *DeleteURLURL
- type GetURL
- type GetURLHandler
- type GetURLHandlerFunc
- type GetURLInternalServerError
- type GetURLOK
- type GetURLParams
- type GetURLURL
- func (o *GetURLURL) Build() (*url.URL, error)
- func (o *GetURLURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetURLURL) Must(u *url.URL, err error) *url.URL
- func (o *GetURLURL) SetBasePath(bp string)
- func (o *GetURLURL) String() string
- func (o *GetURLURL) StringFull(scheme, host string) string
- func (o *GetURLURL) WithBasePath(bp string) *GetURLURL
Constants ¶
const CreateURLCreatedCode int = 201
CreateURLCreatedCode is the HTTP code returned for type CreateURLCreated
const CreateURLInternalServerErrorCode int = 500
CreateURLInternalServerErrorCode is the HTTP code returned for type CreateURLInternalServerError
const DeleteURLBadRequestCode int = 400
DeleteURLBadRequestCode is the HTTP code returned for type DeleteURLBadRequest
const DeleteURLInternalServerErrorCode int = 500
DeleteURLInternalServerErrorCode is the HTTP code returned for type DeleteURLInternalServerError
const DeleteURLNoContentCode int = 204
DeleteURLNoContentCode is the HTTP code returned for type DeleteURLNoContent
const GetURLInternalServerErrorCode int = 500
GetURLInternalServerErrorCode is the HTTP code returned for type GetURLInternalServerError
const GetURLOKCode int = 200
GetURLOKCode is the HTTP code returned for type GetURLOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateURL ¶
type CreateURL struct { Context *middleware.Context Handler CreateURLHandler }
CreateURL swagger:route POST /url Url createUrl
Create a new short url. Specify the URL with the protocol, es: `http://example.com`.
It returns a new short version of the URL that can be used as: http://endpoint/{shortURL}.
func NewCreateURL ¶
func NewCreateURL(ctx *middleware.Context, handler CreateURLHandler) *CreateURL
NewCreateURL creates a new http.Handler for the create Url operation
type CreateURLCreated ¶
CreateURLCreated created
swagger:response createUrlCreated
func NewCreateURLCreated ¶
func NewCreateURLCreated() *CreateURLCreated
NewCreateURLCreated creates CreateURLCreated with default headers values
func (*CreateURLCreated) SetPayload ¶
func (o *CreateURLCreated) SetPayload(payload *models.Shorturl)
SetPayload sets the payload to the create Url created response
func (*CreateURLCreated) WithPayload ¶
func (o *CreateURLCreated) WithPayload(payload *models.Shorturl) *CreateURLCreated
WithPayload adds the payload to the create Url created response
func (*CreateURLCreated) WriteResponse ¶
func (o *CreateURLCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type CreateURLHandler ¶
type CreateURLHandler interface {
Handle(CreateURLParams) middleware.Responder
}
CreateURLHandler interface for that can handle valid create Url params
type CreateURLHandlerFunc ¶
type CreateURLHandlerFunc func(CreateURLParams) middleware.Responder
CreateURLHandlerFunc turns a function with the right signature into a create Url handler
func (CreateURLHandlerFunc) Handle ¶
func (fn CreateURLHandlerFunc) Handle(params CreateURLParams) middleware.Responder
Handle executing the request and returning a response
type CreateURLInternalServerError ¶
type CreateURLInternalServerError struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` }
CreateURLInternalServerError internal server error
swagger:response createUrlInternalServerError
func NewCreateURLInternalServerError ¶
func NewCreateURLInternalServerError() *CreateURLInternalServerError
NewCreateURLInternalServerError creates CreateURLInternalServerError with default headers values
func (*CreateURLInternalServerError) SetPayload ¶
func (o *CreateURLInternalServerError) SetPayload(payload *models.Error)
SetPayload sets the payload to the create Url internal server error response
func (*CreateURLInternalServerError) WithPayload ¶
func (o *CreateURLInternalServerError) WithPayload(payload *models.Error) *CreateURLInternalServerError
WithPayload adds the payload to the create Url internal server error response
func (*CreateURLInternalServerError) WriteResponse ¶
func (o *CreateURLInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type CreateURLParams ¶
type CreateURLParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* In: body */ InfoURL *models.URL }
CreateURLParams contains all the bound params for the create Url operation typically these are obtained from a http.Request
swagger:parameters createUrl
func NewCreateURLParams ¶
func NewCreateURLParams() CreateURLParams
NewCreateURLParams creates a new CreateURLParams object no default values defined in spec.
func (*CreateURLParams) BindRequest ¶
func (o *CreateURLParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewCreateURLParams() beforehand.
type CreateURLURL ¶
type CreateURLURL struct {
// contains filtered or unexported fields
}
CreateURLURL generates an URL for the create Url operation
func (*CreateURLURL) Build ¶
func (o *CreateURLURL) Build() (*url.URL, error)
Build a url path and query string
func (*CreateURLURL) BuildFull ¶
func (o *CreateURLURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*CreateURLURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*CreateURLURL) SetBasePath ¶
func (o *CreateURLURL) SetBasePath(bp string)
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*CreateURLURL) String ¶
func (o *CreateURLURL) String() string
String returns the string representation of the path with query string
func (*CreateURLURL) StringFull ¶
func (o *CreateURLURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*CreateURLURL) WithBasePath ¶
func (o *CreateURLURL) WithBasePath(bp string) *CreateURLURL
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
type DeleteURL ¶
type DeleteURL struct { Context *middleware.Context Handler DeleteURLHandler }
DeleteURL swagger:route DELETE /url/{shortURL} Url deleteUrl
Delete a already existing url. The only argument that is requested is the shortURL to be deleted.
func NewDeleteURL ¶
func NewDeleteURL(ctx *middleware.Context, handler DeleteURLHandler) *DeleteURL
NewDeleteURL creates a new http.Handler for the delete Url operation
type DeleteURLBadRequest ¶
DeleteURLBadRequest bad request
swagger:response deleteUrlBadRequest
func NewDeleteURLBadRequest ¶
func NewDeleteURLBadRequest() *DeleteURLBadRequest
NewDeleteURLBadRequest creates DeleteURLBadRequest with default headers values
func (*DeleteURLBadRequest) SetPayload ¶
func (o *DeleteURLBadRequest) SetPayload(payload *models.Error)
SetPayload sets the payload to the delete Url bad request response
func (*DeleteURLBadRequest) WithPayload ¶
func (o *DeleteURLBadRequest) WithPayload(payload *models.Error) *DeleteURLBadRequest
WithPayload adds the payload to the delete Url bad request response
func (*DeleteURLBadRequest) WriteResponse ¶
func (o *DeleteURLBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type DeleteURLHandler ¶
type DeleteURLHandler interface {
Handle(DeleteURLParams) middleware.Responder
}
DeleteURLHandler interface for that can handle valid delete Url params
type DeleteURLHandlerFunc ¶
type DeleteURLHandlerFunc func(DeleteURLParams) middleware.Responder
DeleteURLHandlerFunc turns a function with the right signature into a delete Url handler
func (DeleteURLHandlerFunc) Handle ¶
func (fn DeleteURLHandlerFunc) Handle(params DeleteURLParams) middleware.Responder
Handle executing the request and returning a response
type DeleteURLInternalServerError ¶
type DeleteURLInternalServerError struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` }
DeleteURLInternalServerError internal server error
swagger:response deleteUrlInternalServerError
func NewDeleteURLInternalServerError ¶
func NewDeleteURLInternalServerError() *DeleteURLInternalServerError
NewDeleteURLInternalServerError creates DeleteURLInternalServerError with default headers values
func (*DeleteURLInternalServerError) SetPayload ¶
func (o *DeleteURLInternalServerError) SetPayload(payload *models.Error)
SetPayload sets the payload to the delete Url internal server error response
func (*DeleteURLInternalServerError) WithPayload ¶
func (o *DeleteURLInternalServerError) WithPayload(payload *models.Error) *DeleteURLInternalServerError
WithPayload adds the payload to the delete Url internal server error response
func (*DeleteURLInternalServerError) WriteResponse ¶
func (o *DeleteURLInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type DeleteURLNoContent ¶
type DeleteURLNoContent struct { }
DeleteURLNoContent deleted
swagger:response deleteUrlNoContent
func NewDeleteURLNoContent ¶
func NewDeleteURLNoContent() *DeleteURLNoContent
NewDeleteURLNoContent creates DeleteURLNoContent with default headers values
func (*DeleteURLNoContent) WriteResponse ¶
func (o *DeleteURLNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type DeleteURLParams ¶
type DeleteURLParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*Short URL to be passed to retrieve long URL Required: true In: path */ ShortURL string }
DeleteURLParams contains all the bound params for the delete Url operation typically these are obtained from a http.Request
swagger:parameters deleteUrl
func NewDeleteURLParams ¶
func NewDeleteURLParams() DeleteURLParams
NewDeleteURLParams creates a new DeleteURLParams object no default values defined in spec.
func (*DeleteURLParams) BindRequest ¶
func (o *DeleteURLParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewDeleteURLParams() beforehand.
type DeleteURLURL ¶
type DeleteURLURL struct { ShortURL string // contains filtered or unexported fields }
DeleteURLURL generates an URL for the delete Url operation
func (*DeleteURLURL) Build ¶
func (o *DeleteURLURL) Build() (*url.URL, error)
Build a url path and query string
func (*DeleteURLURL) BuildFull ¶
func (o *DeleteURLURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*DeleteURLURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*DeleteURLURL) SetBasePath ¶
func (o *DeleteURLURL) SetBasePath(bp string)
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*DeleteURLURL) String ¶
func (o *DeleteURLURL) String() string
String returns the string representation of the path with query string
func (*DeleteURLURL) StringFull ¶
func (o *DeleteURLURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*DeleteURLURL) WithBasePath ¶
func (o *DeleteURLURL) WithBasePath(bp string) *DeleteURLURL
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
type GetURL ¶
type GetURL struct { Context *middleware.Context Handler GetURLHandler }
GetURL swagger:route GET /url/{shortURL} Url getUrl
Get a already existing url. The only argument that is requested is the shortURL to be fetched.
func NewGetURL ¶
func NewGetURL(ctx *middleware.Context, handler GetURLHandler) *GetURL
NewGetURL creates a new http.Handler for the get Url operation
type GetURLHandler ¶
type GetURLHandler interface {
Handle(GetURLParams) middleware.Responder
}
GetURLHandler interface for that can handle valid get Url params
type GetURLHandlerFunc ¶
type GetURLHandlerFunc func(GetURLParams) middleware.Responder
GetURLHandlerFunc turns a function with the right signature into a get Url handler
func (GetURLHandlerFunc) Handle ¶
func (fn GetURLHandlerFunc) Handle(params GetURLParams) middleware.Responder
Handle executing the request and returning a response
type GetURLInternalServerError ¶
type GetURLInternalServerError struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` }
GetURLInternalServerError internal server error
swagger:response getUrlInternalServerError
func NewGetURLInternalServerError ¶
func NewGetURLInternalServerError() *GetURLInternalServerError
NewGetURLInternalServerError creates GetURLInternalServerError with default headers values
func (*GetURLInternalServerError) SetPayload ¶
func (o *GetURLInternalServerError) SetPayload(payload *models.Error)
SetPayload sets the payload to the get Url internal server error response
func (*GetURLInternalServerError) WithPayload ¶
func (o *GetURLInternalServerError) WithPayload(payload *models.Error) *GetURLInternalServerError
WithPayload adds the payload to the get Url internal server error response
func (*GetURLInternalServerError) WriteResponse ¶
func (o *GetURLInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetURLOK ¶
GetURLOK OK
swagger:response getUrlOK
func NewGetURLOK ¶
func NewGetURLOK() *GetURLOK
NewGetURLOK creates GetURLOK with default headers values
func (*GetURLOK) SetPayload ¶
SetPayload sets the payload to the get Url o k response
func (*GetURLOK) WithPayload ¶
WithPayload adds the payload to the get Url o k response
func (*GetURLOK) WriteResponse ¶
func (o *GetURLOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetURLParams ¶
type GetURLParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*Short URL to be passed to retrieve long URL Required: true In: path */ ShortURL string }
GetURLParams contains all the bound params for the get Url operation typically these are obtained from a http.Request
swagger:parameters getUrl
func NewGetURLParams ¶
func NewGetURLParams() GetURLParams
NewGetURLParams creates a new GetURLParams object no default values defined in spec.
func (*GetURLParams) BindRequest ¶
func (o *GetURLParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewGetURLParams() beforehand.
type GetURLURL ¶
type GetURLURL struct { ShortURL string // contains filtered or unexported fields }
GetURLURL generates an URL for the get Url operation
func (*GetURLURL) SetBasePath ¶
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*GetURLURL) StringFull ¶
StringFull returns the string representation of a complete url
func (*GetURLURL) WithBasePath ¶
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string