redirects

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	List(ctx *gin.Context)
	Find(ctx *gin.Context)
	Create(ctx *gin.Context)
	Update(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

Handler defines methods for Redirect routes to interact with the server.

type Redirects

type Redirects struct {
	*deps.Deps
}

Redirects defines the handler for all redirect routes.

func New

func New(d *deps.Deps) *Redirects

New

Creates a new redirects handler.

func (*Redirects) Create

func (r *Redirects) Create(ctx *gin.Context)

Create

Returns http.StatusOK if the redirect was created. Returns http.StatusInternalServerError if there was an error creating the redirect. Returns http.StatusBadRequest if the the validation failed or there was a conflict.

func (*Redirects) Delete

func (r *Redirects) Delete(ctx *gin.Context)

Delete

Returns http.StatusOK if the redirect was deleted. Returns http.StatusInternalServerError if there was an error deleting the redirect. Returns http.StatusBadRequest if the the redirect wasn't found or no ID was passed.

func (*Redirects) Find

func (r *Redirects) Find(ctx *gin.Context)

Find

Returns http.StatusOK if the redirect was obtained. Returns http.StatusInternalServerError if there as an error obtaining the redirect. Returns http.StatusBadRequest if the ID wasn't passed or failed to convert.

func (*Redirects) List

func (r *Redirects) List(ctx *gin.Context)

List

Returns http.StatusOK if there are no redirects or success. Returns http.StatusInternalServerError if there was an error getting the redirects. Returns http.StatusBadRequest if there was conflict or the request was invalid.

func (*Redirects) Update

func (r *Redirects) Update(ctx *gin.Context)

Update

Returns http.StatusOK if the redirect was updated. Returns http.StatusInternalServerError if there was an error updating the redirect. Returns http.StatusBadRequest if the the validation failed or the redirect wasn't found.

Jump to

Keyboard shortcuts

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