url

package
v0.0.0-...-21410c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CreateURLCreatedCode int = 201

CreateURLCreatedCode is the HTTP code returned for type CreateURLCreated

View Source
const CreateURLInternalServerErrorCode int = 500

CreateURLInternalServerErrorCode is the HTTP code returned for type CreateURLInternalServerError

View Source
const DeleteURLBadRequestCode int = 400

DeleteURLBadRequestCode is the HTTP code returned for type DeleteURLBadRequest

View Source
const DeleteURLInternalServerErrorCode int = 500

DeleteURLInternalServerErrorCode is the HTTP code returned for type DeleteURLInternalServerError

View Source
const DeleteURLNoContentCode int = 204

DeleteURLNoContentCode is the HTTP code returned for type DeleteURLNoContent

View Source
const GetURLInternalServerErrorCode int = 500

GetURLInternalServerErrorCode is the HTTP code returned for type GetURLInternalServerError

View Source
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

func (*CreateURL) ServeHTTP

func (o *CreateURL) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type CreateURLCreated

type CreateURLCreated struct {

	/*
	  In: Body
	*/
	Payload *models.Shorturl `json:"body,omitempty"`
}

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

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

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

func (o *CreateURLURL) Must(u *url.URL, err error) *url.URL

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

func (*DeleteURL) ServeHTTP

func (o *DeleteURL) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type DeleteURLBadRequest

type DeleteURLBadRequest struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

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

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

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

func (o *DeleteURLURL) Must(u *url.URL, err error) *url.URL

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

func (*GetURL) ServeHTTP

func (o *GetURL) ServeHTTP(rw http.ResponseWriter, r *http.Request)

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

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

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

type GetURLOK struct {

	/*
	  In: Body
	*/
	Payload *models.URL `json:"body,omitempty"`
}

GetURLOK OK

swagger:response getUrlOK

func NewGetURLOK

func NewGetURLOK() *GetURLOK

NewGetURLOK creates GetURLOK with default headers values

func (*GetURLOK) SetPayload

func (o *GetURLOK) SetPayload(payload *models.URL)

SetPayload sets the payload to the get Url o k response

func (*GetURLOK) WithPayload

func (o *GetURLOK) WithPayload(payload *models.URL) *GetURLOK

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) Build

func (o *GetURLURL) Build() (*url.URL, error)

Build a url path and query string

func (*GetURLURL) BuildFull

func (o *GetURLURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*GetURLURL) Must

func (o *GetURLURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*GetURLURL) SetBasePath

func (o *GetURLURL) 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 (*GetURLURL) String

func (o *GetURLURL) String() string

String returns the string representation of the path with query string

func (*GetURLURL) StringFull

func (o *GetURLURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*GetURLURL) WithBasePath

func (o *GetURLURL) WithBasePath(bp string) *GetURLURL

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL