misc

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: GPL-3.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 Repos

type Repos struct {
	// contains filtered or unexported fields
}

Repos stores our dependencies

func NewRepos

func NewRepos(db *sqlx.DB, access *utils.Accesser) *Repos

NewRepos creates our data store

func (*Repos) DeleteQuote

func (r *Repos) DeleteQuote(c echo.Context) error

DeleteQuote handles deleting quotes @Summary Delete quote @Description deletes a quote by ID. @ID delete-quote @Tags misc-quotes @Param quoteid path int true "Quote ID" @Success 200 @Router /v1/internal/misc/quotes/{quoteid} [delete]

func (*Repos) GetList added in v0.7.0

func (r *Repos) GetList(c echo.Context) error

GetList handles listing a mailing list including the subscribers

@Summary Get Mailing list @Description Get a mailing list. Provides list subscribers also @ID get-mailing-list-id @Tags misc-list @Produce json @Param listid path int true "List ID" @Success 200 {object} misc.List @Router /v1/internal/misc/list/{listid} [get]

func (*Repos) GetLists added in v0.7.0

func (r *Repos) GetLists(c echo.Context) error

GetLists handles listing mailing lists

@Summary Get Mailing lists @Description Lists all mailing lists. @ID get-mailing-lists @Tags misc-list @Produce json @Success 200 {array} misc.List @Router /v1/internal/misc/lists [get]

func (*Repos) GetListsByToken added in v0.7.0

func (r *Repos) GetListsByToken(c echo.Context) error

GetListsByToken handles listing mailing lists enables IsSubscribed check

@Summary Get Mailing lists by token @Description Lists all mailing lists. Provides extra context for what the user has subscribed too @ID get-mailing-lists-token @Tags misc-list @Produce json @Success 200 {array} misc.List @Router /v1/internal/misc/lists/my [get]

func (*Repos) GetSubscribers added in v0.7.0

func (r *Repos) GetSubscribers(c echo.Context) error

GetSubscribers handles listing a mailing list's subscribers

@Summary Get subscribers @Description Get a mailing list's subscribers @ID get-mailing-list-subscribers-id @Tags misc-list @Produce json @Param listid path int true "List ID" @Success 200 {object} misc.List @Router /v1/internal/misc/list/{listid}/subscribers [get]

func (*Repos) GetWebcam

func (r *Repos) GetWebcam(c echo.Context) error

GetWebcam handles reverse proxying a webcam @Summary Get webcam @Description Reverse proxies the selected webcam returns the jpeg feed as a result. @ID get-webcam @Tags misc-webcams @Param cameraid path int true "Camera ID" @Router /v1/internal/misc/webcams/{cameraid} [get]

func (*Repos) ListQuotes

func (r *Repos) ListQuotes(c echo.Context) error

ListQuotes handles listing quotes by pagination @Summary List quotes @Description Lists quotes by pagination. @ID get-quotes @Tags misc-quotes @Produce json @Param amount path int true "Amount" @Param page path int true "Page" @Success 200 {array} misc.QuotePage @Router /v1/internal/misc/quotes/{amount}/{page} [get]

func (*Repos) ListWebcams

func (r *Repos) ListWebcams(c echo.Context) error

ListWebcams handles listing all webcams a user can access @Summary List webcams @Description List webcams available to user by using the permission ID @ID list-webcams @Tags misc-webcams @Success 200 {array} misc.Webcam @Router /v1/internal/misc/webcams [get]

func (*Repos) NewQuote

func (r *Repos) NewQuote(c echo.Context) error

NewQuote handles creating a quote @Summary New quote @Description creates a new quote. @Description web-api will overwrite created by User ID with the token's user ID. @ID new-quote @Tags misc-quotes @Accept json @Param quote body misc.Quote true "Quote object" @Success 201 {object} int "Quote ID" @Router /v1/internal/misc/quotes [post]

func (*Repos) SubscribeByID added in v0.7.0

func (r *Repos) SubscribeByID(c echo.Context) error

SubscribeByID handles subscribing a user to a mailing list

@Summary Subscribe to mailing list by user ID @Description Subscribe to a mailing list by a user ID @ID new-mailing-list-subscriber-id @Tags misc-list @Accept json @Param listid path int true "List ID" @Param userid path int true "User ID" @Success 201 @Router /v1/internal/misc/list/{listid}/subscribe/{userid} [post]

func (*Repos) SubscribeByToken added in v0.7.0

func (r *Repos) SubscribeByToken(c echo.Context) error

SubscribeByToken handles subscribing a user to a mailing list

@Summary Subscribe to mailing list by token @Description Subscribe to a mailing list by a JWT @ID new-mailing-list-subscriber-token @Tags misc-list @Accept json @Param listid path int true "List ID" @Success 201 @Router /v1/internal/misc/list/{listid}/subscribe [post]

func (*Repos) UnsubscribeByID added in v0.7.0

func (r *Repos) UnsubscribeByID(c echo.Context) error

UnsubscribeByID handles subscribing a user to a mailing list

@Summary Unsubscribe to mailing list by user ID @Description Unsubscribe to a mailing list by a user ID @ID delete-mailing-list-subscriber-id @Tags misc-list @Accept json @Param listid path int true "List ID" @Param userid path int true "User ID" @Success 200 @Router /v1/internal/misc/list/{listid}/unsubscribe/{userid} [delete]

func (*Repos) UnsubscribeByToken added in v0.7.0

func (r *Repos) UnsubscribeByToken(c echo.Context) error

UnsubscribeByToken handles unsubscribing a user to a mailing list

@Summary Unsubscribe to mailing list by token @Description Unsubscribe to a mailing list by a JWT @ID delete-mailing-list-subscriber-token @Tags misc-list @Accept json @Param listid path int true "List ID" @Success 200 @Router /v1/internal/misc/list/{listid}/unsubscribe [delete]

func (*Repos) UnsubscribeByUUID added in v0.7.0

func (r *Repos) UnsubscribeByUUID(c echo.Context) error

UnsubscribeByUUID handles subscribing a user to a mailing list

@Summary Unsubscribe to mailing list by subscriber UUID @Description Unsubscribe to a mailing list by a subscriber UUID @ID delete-mailing-list-subscriber-uuid @Tags misc-list @Accept json @Param uuid path int true "Subscriber UUID" @Success 200 @Router /v1/list_unsubscribe/{uuid} [get]

func (*Repos) UpdateQuote

func (r *Repos) UpdateQuote(c echo.Context) error

UpdateQuote handles updating a quote @Summary Update quote @Description updates a quote. Still need to provide the whole Quote object, @Description web-api will overwrite created by User ID to keep with existing record. @ID update-quote @Tags misc-quotes @Accept json @Param quote body misc.Quote true "Quote object" @Success 200 @Router /v1/internal/misc/quotes [put]

Jump to

Keyboard shortcuts

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