handlers

package
v0.0.0-...-1aa1bea Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserResponse

type GetUserResponse struct {
	User *dtos.User `json:"user"`
}

type UpdateUserResponse

type UpdateUserResponse struct {
	Token string     `json:"session"`
	User  *dtos.User `json:"user"`
}

UpdateUserResponse is the response of a update user command.

type UserHandler

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

func NewUserHandler

func NewUserHandler(logger *zap.SugaredLogger, userDB database.UserDB, statusDB database.OnlineStatusDB) *UserHandler

func (*UserHandler) DeleteUser

func (h *UserHandler) DeleteUser(rw http.ResponseWriter, r *http.Request)

func (*UserHandler) GetUser

func (h *UserHandler) GetUser(rw http.ResponseWriter, r *http.Request)

GetUser returns the authenticated user object swagger:route GET /api/user account getUser

return the authenticated user based on the api key
Consumes:

Produces:
-	application/json
Schemes: http, https

Security:
	api_key:

Responses:
default: ErrorResponse
401: ErrorResponse
404: ErrorResponse
500: ErrorResponse
200: UserResponse

func (*UserHandler) UpdateUser

func (h *UserHandler) UpdateUser(rw http.ResponseWriter, r *http.Request)

func (*UserHandler) UserStatus

func (h *UserHandler) UserStatus(rw http.ResponseWriter, r *http.Request)

type UserStatusResponse

type UserStatusResponse struct {
	OnlineStatus *database.OnlineStatus `json:"online"`
	Banned       byte                   `json:"banned"`
	Verified     byte                   `json:"verified"`
}

Jump to

Keyboard shortcuts

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