Documentation ¶
Index ¶
- func CheckKeyPair(c *gin.Context)
- func CheckSession(c *gin.Context)
- func CreateEmail(c *gin.Context)
- func CreateKeyPair(c *gin.Context)
- func CreateSession(c *gin.Context)
- func CreateUser(c *gin.Context)
- func GetEmails(c *gin.Context)
- func GetUser(c *gin.Context)
- func NotFound(c *gin.Context)
- func Robots(c *gin.Context)
- func VerifyEmail(c *gin.Context)
- func VerifyKeyPair(c *gin.Context)
- func VerifySession(c *gin.Context)
- type AuthorizationHeader
- type ErrorResponse
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckKeyPair ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 VerifyEmail ¶
@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 ¶
@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 ¶
@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 ErrorResponse ¶
type SuccessResponse ¶
type SuccessResponse struct {
Message string `json:"message" example:"acknowledged"`
}