Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JWTKey = []byte(os.Getenv("JWT_SECRET_KEY"))
JWTKey is used to create the signature
Functions ¶
Types ¶
type Account ¶
type Account struct { // the id for this account // required: true // min: 1 ID uint `json:"id"` // the name of this account // required: true Name string `json:"name" validate:"required"` // the email of this account // required: true Email *string `json:"email" validate:"required"` // the password for this account // required: true Password string `json:"-" validate:"required"` // the username of this account // required: true Username string `json:"username" validate:"required"` // the age of this account Age uint8 `json:"age"` // the birthday of this account // required: true Birthday *time.Time `json:"birthday" validate:"required"` ActivatedAt sql.NullTime `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Account is the database struct swagger:model
type Claims ¶
type Claims struct { Email string `json:"email"` jwt.StandardClaims }
Claims is a struct that will be encoded in a jwt
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database for creating connection and handling transaction to the database
func NewDatabase ¶
NewDatabase returns a new database connection with the given logger
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
Validation contains following fields
func (*Validation) Validate ¶
func (v *Validation) Validate(i interface{}) ValidationErrors
Validate the item
type ValidationError ¶
type ValidationError struct {
validator.FieldError
}
ValidationError wraps the validators FieldError
type ValidationErrors ¶
type ValidationErrors []ValidationError
ValidationErrors is a collection of ValidationError
Click to show internal directories.
Click to hide internal directories.