disciplinary_log

package
v0.0.0-...-48f5382 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDisciplinaryLogEntry

func CreateDisciplinaryLogEntry(w http.ResponseWriter, r *http.Request)

CreateDisciplinaryLogEntry godoc @Summary Create a new disciplinary log entry @Description Create a new disciplinary log entry @Tags disciplinary-log @Accept json @Produce json @Param cid path int true "User CID" @Param action_log body Request true "Disciplinary Log Entry" @Success 201 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/disciplinary-log [post]

func Ctx

func Ctx(next http.Handler) http.Handler

func DeleteDisciplinaryLogEntry

func DeleteDisciplinaryLogEntry(w http.ResponseWriter, r *http.Request)

DeleteDisciplinaryLogEntry godoc @Summary Delete a disciplinary log entry @Description Delete a disciplinary log entry @Tags disciplinary-log @Accept json @Produce json @Param cid path int true "User CID" @Param id path int true "Disciplinary Log Entry ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/disciplinary-log/{id} [delete]

func GetDisciplinaryLog

func GetDisciplinaryLog(w http.ResponseWriter, r *http.Request)

GetDisciplinaryLog godoc @Summary Get all disciplinary log entries @Description List all disciplinary log entries @Tags disciplinary-log @Accept json @Produce json @Param cid path int true "User CID" @Param vatusa_only query bool false "VATUSA Only" @Success 200 {object} []Response @Failure 422 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/disciplinary-log [get]

func NewDisciplinaryLogEntryListResponse

func NewDisciplinaryLogEntryListResponse(dle []models.DisciplinaryLogEntry) []render.Renderer

func PatchDisciplinaryLogEntry

func PatchDisciplinaryLogEntry(w http.ResponseWriter, r *http.Request)

PatchDisciplinaryLogEntry godoc @Summary Patch an disciplinary log entry @Description Patch an disciplinary log entry @Tags disciplinary-log @Accept json @Produce json @Param cid path int true "User CID" @Param id path int true "Disciplinary Log Entry ID" @Param disciplinary_log body Request true "Disciplinary Log Entry" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/disciplinary-log/{id} [patch]

func Router

func Router(r chi.Router)

func UpdateDisciplinaryLogEntry

func UpdateDisciplinaryLogEntry(w http.ResponseWriter, r *http.Request)

UpdateDisciplinaryLogEntry godoc @Summary Update a disciplinary log entry @Description Update a disciplinary log entry @Tags disciplinary-log @Accept json @Produce json @Param id path int true "Disciplinary Log Entry ID" @Param disciplinary_log body Request true "Disciplinary Log Entry" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/disciplinary-log/{id} [put]

Types

type Request

type Request struct {
	Entry      string `json:"entry" example:"Misconduct in discord" validate:"required"`
	VATUSAOnly bool   `json:"vatusa_only" example:"true"`
}

func (*Request) Bind

func (req *Request) Bind(r *http.Request) error

func (*Request) Validate

func (req *Request) Validate() error

type Response

type Response struct {
	*models.DisciplinaryLogEntry
}

func NewDisciplinaryLogEntryResponse

func NewDisciplinaryLogEntryResponse(dle *models.DisciplinaryLogEntry) *Response

func (*Response) Render

func (res *Response) Render(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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