invites

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: 12 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 Invites.

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 invite by the provided {inviteId}

func (*Handler) Get

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

Get handler returns a invite by the provided {inviteId}

func (*Handler) InviteCtx

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

InviteCtx handler loads a invite by either {inviteId} or {inviteEmail}

func (*Handler) List

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

List handler returns all invites in JSON format.

func (*Handler) Store

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

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

func (*Handler) Update

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

Update handler updates a invite by the provided {inviteId}

type InviteRequest

type InviteRequest struct {
	*models.Invite
}

InviteRequest is a pointer to the Invite model.

func (*InviteRequest) Bind

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

Bind validates the InviteRequest body for required fields.

Jump to

Keyboard shortcuts

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