forms

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forms

type Forms struct {
	*deps.Deps
	// contains filtered or unexported fields
}

Forms defines the handler for all form routes.

func New

func New(d *deps.Deps) *Forms

New

Creates a new forms handler.

func (*Forms) Create

func (f *Forms) Create(ctx *gin.Context)

Create

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

func (*Forms) Delete

func (f *Forms) Delete(ctx *gin.Context)

Delete

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

func (*Forms) Find

func (f *Forms) Find(ctx *gin.Context)

Find

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

func (*Forms) List

func (f *Forms) List(ctx *gin.Context)

List

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

func (*Forms) Send

func (f *Forms) Send(ctx *gin.Context)

Send

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

func (*Forms) Update

func (f *Forms) Update(ctx *gin.Context)

Update

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

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)
	Send(ctx *gin.Context)
}

Handler defines methods for forms to interact with the server.

Jump to

Keyboard shortcuts

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