handler

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisterRoute          = "/register"
	LoginRoute             = "/login"
	SensorRoute            = "/sensor"
	StationRoute           = "/station"
	StationRouteWithParams = StationRoute + "/:" + UUIDParam
	HistoricalRoute        = "/historical"
	AccountRoute           = "/account"
	EchoRoute              = "/echo"
	AlertRoute             = "/alert"
	AlertRouteWithParam    = AlertRoute + "/:" + UUIDParam
	ResetPasswordRoute     = "/reset/password"
	ConfirmAccountRoute    = "/confirm/account"
)
View Source
const (
	RootRoute = "/"
)
View Source
const (
	SessionVariable = "SESSION_VARIABLE"
)
View Source
const (
	UUIDParam = "uuid"
)

Variables

View Source
var (
	SucceedResponse      = Response{Message: "Succeed"}
	UnauthorizedResponse = Response{Message: "Unauthorized"}
)

Functions

This section is empty.

Types

type ConfirmRequest

type ConfirmRequest struct {
	ConfirmCode string `json:"confirmCode"`
}

type Handler

type Handler struct {
	Controller      *models.Controller
	MessageProducer *memphis.Producer
	*gin.Engine
}

func New

func New(c *models.Controller, msgProducer *memphis.Producer) *Handler

func (*Handler) Authorize

func (h *Handler) Authorize(ctx *gin.Context)

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) ConfirmAccount

func (h *Handler) ConfirmAccount(ctx *gin.Context)

func (*Handler) CreateAlert

func (h *Handler) CreateAlert(ctx *gin.Context)

func (*Handler) CreateSensors

func (h *Handler) CreateSensors(ctx *gin.Context)

func (*Handler) CreateStation

func (h *Handler) CreateStation(ctx *gin.Context)

func (*Handler) DeleteAlert

func (h *Handler) DeleteAlert(ctx *gin.Context)

func (*Handler) DeleteSensors

func (h *Handler) DeleteSensors(ctx *gin.Context)

func (*Handler) DeleteStation

func (h *Handler) DeleteStation(ctx *gin.Context)

func (*Handler) Echo

func (h *Handler) Echo(ctx *gin.Context)

func (*Handler) Historical

func (h *Handler) Historical(ctx *gin.Context)

func (*Handler) Login

func (h *Handler) Login(ctx *gin.Context)

func (*Handler) OptionalAuth added in v0.0.3

func (h *Handler) OptionalAuth(ctx *gin.Context)

func (*Handler) QueryAccount

func (h *Handler) QueryAccount(ctx *gin.Context)

func (*Handler) QueryAlert

func (h *Handler) QueryAlert(ctx *gin.Context)

func (*Handler) QueryStation

func (h *Handler) QueryStation(ctx *gin.Context)

func (*Handler) Register

func (h *Handler) Register(ctx *gin.Context)

func (*Handler) RequestConfirmAccount

func (h *Handler) RequestConfirmAccount(ctx *gin.Context)

func (*Handler) RequestPasswordReset

func (h *Handler) RequestPasswordReset(ctx *gin.Context)

func (*Handler) ResetPassword

func (h *Handler) ResetPassword(ctx *gin.Context)

func (*Handler) SearchAlerts

func (h *Handler) SearchAlerts(ctx *gin.Context)

func (*Handler) SearchStations

func (h *Handler) SearchStations(ctx *gin.Context)

func (*Handler) UpdateAccount

func (h *Handler) UpdateAccount(ctx *gin.Context)

func (*Handler) UpdateAlert

func (h *Handler) UpdateAlert(ctx *gin.Context)

func (*Handler) UpdateStation

func (h *Handler) UpdateStation(ctx *gin.Context)

type ResetRequest

type ResetRequest struct {
	ResetCode   string `json:"resetCode"`
	NewPassword string `json:"newPassword"`
}

type Response

type Response struct {
	Message string `json:"message"`
}

type UpdateAccountRequest

type UpdateAccountRequest struct {
	User        tables.User `json:"user"`
	OldPassword string      `json:"oldPassword"`
}

Jump to

Keyboard shortcuts

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