tags

package
v0.0.0-...-c950848 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(r chi.Router, db *pg.DB) chi.Router

Routes consists of the route method declarations for Tags.

Types

type Handler

type Handler core.Handler

Handler consists of the DB connection and Routes

func (*Handler) Delete

func (cw *Handler) Delete(w http.ResponseWriter, r *http.Request)

Delete handler deletes a tag by the provided {tagId}

func (*Handler) Get

func (cw *Handler) Get(w http.ResponseWriter, r *http.Request)

Get handler returns a tag by the provided {tagId}

func (*Handler) List

func (cw *Handler) List(w http.ResponseWriter, r *http.Request)

List handler returns all tags in JSON format.

func (*Handler) Store

func (cw *Handler) Store(w http.ResponseWriter, r *http.Request)

Store handler creates a new tag and returns the tag in JSON format.

func (*Handler) TagCtx

func (cw *Handler) TagCtx(next http.Handler) http.Handler

TagCtx handler loads a tag by either {tagId} or {tagSlug}

func (*Handler) Update

func (cw *Handler) Update(w http.ResponseWriter, r *http.Request)

Update handler updates a tag by the provided {tagId}

type TagRequest

type TagRequest struct {
	*models.Tag
}

TagRequest is a pointer to the Tag model.

func (*TagRequest) Bind

func (t *TagRequest) Bind(r *http.Request) error

Bind validates the TagRequest body for required fields.

Jump to

Keyboard shortcuts

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