Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod int
AuthMethod is a authentication mark
const ( // LOCAL authentication LOCAL AuthMethod = 0 // GOOGLE authentication GOOGLE AuthMethod = 1 // FACEBOOK authentication FACEBOOK AuthMethod = 2 )
type Configuration ¶
type Configuration struct { Port string `json:"app_port" env:"APP_PORT"` DatabaseName string `json:"database_name" env:"DATABASE_NAME"` DatabaseEndPoint string `json:"database_endpoint" env:"DATABASE_ENDPOINT"` DatabaseUser string `json:"database_user" env:"DATABASE_USER"` DatabasePassword string `json:"database_password" env:"DATABASE_PASSWORD"` MailFrom string `json:"mail_from" env:"MAIL_FROM"` MailSubjectConfirmAccount string `json:"mail_subject_confirm_account" env:"MAIL_SUBJECT_CONFIRM_ACCOUNT"` MailSubjectRecoveryAccount string `json:"mail_subject_recovery_account" env:"MAIL_SUBJECT_RECOVERY_ACCOUNT"` MailConfirmationLink string `json:"mail_confirmation" env:"MAIL_CONFIRMATION"` MailSuccessRedirect string `json:"mail_success" env:"MAIL_SUCCESS"` MailFailedRedirect string `json:"mail_failed" env:"MAIL_FAILED"` MailPassword string `json:"mail_password" env:"MAIL_PASSWORD"` MailAddress string `json:"mail_address" env:"MAIL_ADDRESS"` SMTPAddress string `json:"mail_smtp" env:"MAIL_SMTP"` SMTPPort string `json:"mail_smtp_port" env:"MAIL_SMTP_PORT"` AccessTokenValidityTime time.Duration `json:"access_token_validity_time" env:"ACCESS_TOKEN_VALIDITY_TIME"` RefreshTokenValidityTime time.Duration `json:"refresh_token_validity_time" env:"REFRESH_TOKEN_VALIDITY_TIME"` }
Configuration struct is used to load configuration from file or environnement
type LoginPayload ¶
type LoginPayload struct { Username string `json:"username" binding:"required" example:"sankamille"` Password string `json:"password" binding:"required" example:"password123"` }
LoginPayload is the login model
type LoginResponsePayload ¶
type LoginResponsePayload struct { Success bool `json:"success" binding:"required"` Message string `json:"message" binding:"required"` Token string `json:"token" binding:"required"` User User `json:"user" binding:"required"` RefreshToken string `json:"refresh-token" binding:"required"` }
LoginResponsePayload is the login response
type RecoveryPayload ¶
type RecoveryPayload struct {
Email string `json:"email" binding:"required" exemple:"luc.brulet@epitech.eu"`
}
RecoveryPayload is the recovery model
type RegisterPayload ¶
type RegisterPayload struct { Username string `json:"username" binding:"required" example:"sankamille"` Email string `json:"email" binding:"required" example:"luc.brulet@epitech.eu"` Password string `json:"password" binding:"required" example:"password123"` }
RegisterPayload is the register model
type RegisterResponsePayload ¶
type RegisterResponsePayload struct { Success bool `json:"success" binding:"required"` Message string `json:"message" binding:"required"` Token string `json:"token" binding:"required"` User User `json:"user" binding:"required"` }
RegisterResponsePayload is the register response
type ResponsePayload ¶
type ResponsePayload struct { Success bool `json:"success" binding:"required"` Message interface{} `json:"message" binding:"required"` }
ResponsePayload is the api response
type TemplateRecovery ¶
TemplateRecovery struct is used to fill the mail recovery template
type User ¶
type User struct { ID int `json:"id"` Username string `json:"username" binding:"required"` Email string `json:"email" binding:"required"` Password string `json:"-"` Admin bool `json:"admin"` Verified bool `json:"verified"` AuthMethod AuthMethod `json:"-" binding:"required"` // contains filtered or unexported fields }
User is a struct about a user
Click to show internal directories.
Click to hide internal directories.