handlers

package
v0.0.0-...-8ca9a05 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckKeyPair

func CheckKeyPair(c *gin.Context)

@Tags Keys @Summary Check key pair @Description Check key pair and returns privileges @Produce application/json @Param api-key header string true "API Key" @Param api-secret header string true "API Secret" @Success 200 {object} controllers.CheckKeyPairResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 407 {object} ErrorResponse "Authentication required" @Failure 500 {object} ErrorResponse "Internal server error" @Router /keypair [get]

func CheckSession

func CheckSession(c *gin.Context)

@Tags Session @Summary Check session @Description Check user session and returns privileges @Produce application/json @Param Authorization header string true "Authorization header" @Success 200 {object} controllers.CheckSessionResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 500 {object} ErrorResponse "Internal server error" @Router /session [get]

func CreateEmail

func CreateEmail(c *gin.Context)

@Tags Email @Summary Create email @Description Create new email and send the verification code @Accept application/json @Produce application/json @Param Authorization header string true "Authorization header" @Param message body controllers.CreateEmailRequest true "JSON" @Success 202 {object} controllers.CreateEmailResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 409 {object} ErrorResponse "Conflict" @Failure 500 {object} ErrorResponse "Internal server error" @Router /email [post]

func CreateKeyPair

func CreateKeyPair(c *gin.Context)

@Tags Keys @Summary Create key pair @Description Create key pair and return it and the verification code ID @Accept application/json @Produce application/json @Param Authorization header string true "Authorization header" @Param message body controllers.CreateKeyPairRequest true "JSON" @Success 202 {object} controllers.CreateKeyPairResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 500 {object} ErrorResponse "Internal server error" @Router /keypair [post]

func CreateSession

func CreateSession(c *gin.Context)

@Tags Session @Summary Create session @Description Start a new session and send one time password @Produce application/json @Param message body controllers.CreateSessionRequest true "JSON" @Success 202 {object} controllers.CreateSessionResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 500 {object} ErrorResponse "Internal server error" @Router /session [post]

func CreateUser

func CreateUser(c *gin.Context)

@Tags User @Summary Create user @Description Create new user and send the details in the response @Accept application/json @Produce application/json @Param message body controllers.CreateUserRequest true "JSON" @Success 202 {object} controllers.CreateUserResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 409 {object} ErrorResponse "Conflict" @Failure 500 {object} ErrorResponse "Internal server error" @Router /user [post]

func GetEmails

func GetEmails(c *gin.Context)

@Tags Email @Summary Get emails @Description Get all emails from the current user @Accept application/json @Produce application/json @Param Authorization header string true "Authorization header" @Success 200 {object} controllers.GetEmailsResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 500 {object} ErrorResponse "Internal server error" @Router /emails [get]

func GetUser

func GetUser(c *gin.Context)

@Tags User @Summary Get user @Description Get user information @Accept application/json @Produce application/json @Param Authorization header string true "Authorization header" @Param userID query string true "User ID" @Success 200 {object} controllers.GetUserResponse "User" @Failure 400 {object} ErrorResponse "Bad request" @Failure 404 {object} ErrorResponse "Not found" @Failure 500 {object} ErrorResponse "Internal server error" @Router /user [get]

func NotFound

func NotFound(c *gin.Context)

func Robots

func Robots(c *gin.Context)

func VerifyEmail

func VerifyEmail(c *gin.Context)

@Tags Email @Summary Verify email @Description Check if email is valid using the verification code sent at the moment of create the email. @Accept application/json @Produce application/json @Param Authorization header string true "Authorization header" @Param message body controllers.VerifyEmailRequest true "JSON" @Success 202 {object} SuccessResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Authentication required" @Failure 403 {object} ErrorResponse "Forbidden" @Failure 500 {object} ErrorResponse "Internal server error" @Router /email/verification [put]

func VerifyKeyPair

func VerifyKeyPair(c *gin.Context)

@Tags Keys @Summary Verify key pair @Description Verify key pair using code sent by SMS @Produce application/json @Param Authorization header string true "Authorization header" @Param message body controllers.VerifyKeyPairRequest true "JSON" @Success 202 {object} SuccessResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 401 {object} ErrorResponse "Unauthorized" @Failure 403 {object} ErrorResponse "Forbidden" @Failure 500 {object} ErrorResponse "Internal server error" @Router /keypair/verification [put]

func VerifySession

func VerifySession(c *gin.Context)

@Tags Session @Summary Verify session @Description Verify Sign-in using code sent by SMS @Produce application/json @Param message body controllers.VerifySessionRequest true "JSON" @Success 202 {object} SuccessResponse "Accepted" @Failure 400 {object} ErrorResponse "Bad request" @Failure 500 {object} ErrorResponse "Internal server error" @Router /session/verification [put]

Types

type AuthorizationHeader

type AuthorizationHeader struct {
	Authorization string `header:"Authorization"`
	APIKey        string `header:"api-key"`
	APISecret     string `header:"api-secret"`
}

type ErrorResponse

type ErrorResponse struct {
	UUID  string `json:"uuid" example:"6070686d-917d-44bb-ad11-02345a7f1939"`
	Error string `json:"error" example:"error description"`
}

type SuccessResponse

type SuccessResponse struct {
	Message string `json:"message" example:"acknowledged"`
}

Jump to

Keyboard shortcuts

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