Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CoreError ¶
type CoreError struct { // Code is CAPS_CASE constant error code you can programmatically consume to make resolution decisions from Code errorcode.ErrorCode `json:"code" example:"ERROR_CODE"` // Message indicate a (usually) human-readable description of the error Message string `json:"message" example:"error cause description"` }
CoreError is a basic representation of API call error
@Description Basic representation of API call error
func (*CoreError) ErrorMessage ¶
type SuspendedUserError ¶
type SuspendedUserError struct {
UserID string
}
func (*SuspendedUserError) Error ¶
func (e *SuspendedUserError) Error() string
type Tokens ¶
type Tokens struct { AccessToken string `json:"accessToken" example:"header.payload.signature"` RefreshToken string `json:"refreshToken" example:"header.payload.signature"` }
Tokens is a pair of access and refresh token which uses for auth operations
@Description Pair of access and refresh token which uses for auth operations
type TokensUIDs ¶
type TokensUIDs struct { AccessTokenUID string `json:"accessTokenUID"` RefreshTokenUID string `json:"refreshTokenUID"` }
TokensUIDs is additional layer of abstraction which we need for security reasons and for performing auth operations
type User ¶
type User struct { ID primitive.ObjectID `json:"id" example:"63a75a2574ef628a127ee972"` Username string `json:"username" example:"kenplix"` Email string `json:"email" example:"tolstoi.job@gmail.com"` CreatedAt time.Time `json:"createdAt" example:"2022-12-24T21:49:33.072726+02:00"` // UpdatedAt is a date of last user personal information modification UpdatedAt time.Time `json:"updatedAt" example:"2022-12-24T21:58:27.072726+02:00"` // SuspendedAt is a date when user was suspended through certain reasons (optional) SuspendedAt *time.Time `json:"suspendedAt,omitempty" example:"2022-12-25T14:25:58.821989+02:00"` }
User entity information
@Description User entity information
type UserModel ¶
type UserModel struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Username string `json:"username" bson:"username"` Email string `json:"email" bson:"email"` PasswordHash string `json:"passwordHash" bson:"passwordHash"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"` SuspendedAt *time.Time `json:"suspendedAt,omitempty" bson:"suspendedAt"` }
type ValidationError ¶
type ValidationError struct { CoreError // Field with which validation error related Field string `json:"field" example:"invalid field"` }
ValidationError is a standardized representation of a validation errors
@Description Standardized representation of a validation errors
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.