Documentation ¶
Index ¶
Constants ¶
View Source
const ( DbUser = "admin" DbPass = "3425" DbHost = "127.0.0.1" DbPort = 3307 DbName = "auth" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthResponse ¶
type AuthResponse struct {
Token string `json:"token"`
}
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type Login ¶
type Login struct { LoginName string `json:"userName,omitempty" example:"piter"` Email string `json:"email,omitempty" example:"piter.teste@example.com"` Password string `json:"password,omitempty" example:"123"` }
Login representa um login. swagger:response loginResponse
type TokenValidRequest ¶
type TokenValidRequest struct {
Token string `json:"token,omitempty"`
}
TokenValidRequest representa um TokenValidRequest. swagger:response TokenValidResponse
type TokenValidResponse ¶
type TokenValidResponse struct { IsValid bool `json:"isValid,omitempty"` Token string `json:"token,omitempty"` }
TokenValidResponse representa um TokenValidResponse. swagger:response TokenValidResponse
type User ¶
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id" swaggerignore:"true"` UserName string `gorm:"size:20;not null;unique_index" json:"userName,omitempty" example:"piter"` Email string `gorm:"size:35;not null;unique_index" json:"email,omitempty" example:"piter.teste@example.com"` Password string `gorm:"size:60;not null" json:"password,omitempty" example:"123"` CreatedAt *time.Time `gorm:"default:current_timestamp()" json:"created_at" swaggerignore:"true"` UpdatedAt *time.Time `gorm:"default:current_timestamp()" json:"updated_at" swaggerignore:"true"` AuditLogin *time.Time `gorm:"<-:false" json:"auditLogin" swaggerignore:"true"` Rule string `gorm:"not null" json:"rule,omitempty" example:"ADMIN"` }
User represents a user. swagger:response userResponse
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id" swaggerignore:"true"` UserName string `gorm:"default:user_name size:20;not null;unique_index" json:"userName,omitempty" example:"piter"` Email string `gorm:"size:35;not null;unique_index" json:"email,omitempty" example:"piter.teste@example.com"` Password string `gorm:"size:60;not null" json:"password,omitempty" example:"123"` CreatedAt *time.Time `gorm:"default:current_timestamp()" json:"created_at" swaggerignore:"true"` UpdatedAt *time.Time `gorm:"default:current_timestamp()" json:"updated_at" swaggerignore:"true"` AuditLogin *time.Time `gorm:"<-:false" json:"auditLogin" swaggerignore:"true"`
User represents a user. swagger:response userResponse
type UserWithoutPassword ¶
type UserWithoutPassword struct { ID uint32 `json:"id"` UserName string `json:"userName,omitempty"` Email string `json:"email,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
UserWithoutPassword represents a user. swagger:response userResponse
Click to show internal directories.
Click to hide internal directories.