Documentation ¶
Index ¶
- type AuthChallenge
- type Authorize
- type Error
- type Permission
- type Response
- func (r *Response) Echo(overrideStatusCodes ...int)
- func (r *Response) Error(err error) *Response
- func (r *Response) ErrorMsg(err error) *Response
- func (r *Response) GetResponse() map[string]interface{}
- func (r *Response) GetServiceError() serviceerror.Error
- func (r *Response) GetStatusCodeMapping() map[serviceerror.ErrorMessage]int
- func (r *Response) InvalidRequest(err error) *Response
- func (r *Response) Message(msg string) *Response
- func (r *Response) Meta(data interface{}) *Response
- func (r *Response) Payload(data interface{}) *Response
- func (r *Response) Validation(err error) *Response
- type Role
- type TOTPKey
- type Token
- type User
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthChallenge ¶
type AuthChallenge struct { Type string `json:"type,omitempty" example:"Basic"` Status string `json:"status,omitempty" example:"ACTIVE"` }
func PrepareAuthChallenge ¶
func PrepareAuthChallenge(authChallenges []domain.AuthChallenge) []AuthChallenge
type Permission ¶
type Permission struct { ID string `json:"id,omitempty" example:"8f4a1582-6a67-4d85-950b-2d17049c7385"` Title *string `json:"title,omitempty" example:"Admin"` Group *string `json:"group,omitempty" example:"user_role"` Description *string `json:"description,omitempty" example:"Admin description"` }
func PreparePermission ¶
func PreparePermission(permission *domain.Permission) *Permission
func ToPermissionCollection ¶
func ToPermissionCollection(permissions []*domain.Permission) []Permission
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse( ctx *gin.Context, trans translation.Translator, statusCodeMappings ...map[serviceerror.ErrorMessage]int, ) *Response
func (*Response) GetResponse ¶
func (*Response) GetServiceError ¶
func (r *Response) GetServiceError() serviceerror.Error
func (*Response) GetStatusCodeMapping ¶
func (r *Response) GetStatusCodeMapping() map[serviceerror.ErrorMessage]int
func (*Response) InvalidRequest ¶
func (*Response) Validation ¶
type Role ¶
type Role struct { ID string `json:"id" example:"8f4a1582-6a67-4d85-950b-2d17049c7385"` Title string `json:"title" example:"Admin"` Description string `json:"description,omitempty" example:"Admin description"` IsDefault bool `json:"isDefault,omitempty" example:"true"` Permissions []Permission `json:"permissions,omitempty"` }
func PrepareRole ¶
func ToRoleCollection ¶
func ToRoleResource ¶
type TOTPKey ¶
type TOTPKey struct { Secret string `json:"secret" example:"secret"` URL string `json:"url" example:"otpauth_url"` }
func ToTOTPResource ¶
type Token ¶
type Token struct {
AccessToken *string `json:"accessToken,omitempty" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"`
}
func ToTokenResource ¶
type User ¶
type User struct { ID string `json:"id,omitempty" example:"8f4a1582-6a67-4d85-950b-2d17049c7385"` FirstName *string `json:"firstName,omitempty" example:"john"` LastName *string `json:"lastName,omitempty" example:"doe"` Email string `json:"email,omitempty" example:"john.doe@gmail.com"` Status string `json:"status,omitempty" example:"ACTIVE"` Gender *string `json:"gender,omitempty" example:"MALE"` AuthChallenges []AuthChallenge `json:"authChallenges"` }
func PrepareUser ¶
func ToUserCollection ¶
func ToUserResource ¶
type ValidationError ¶
type ValidationError struct { Field string `json:"field" example:"email"` Message string `json:"message" example:"The email must be a valid email address."` }
func Translate ¶
func Translate(trans translation.Translator, err error) (validationErrors []ValidationError)
Click to show internal directories.
Click to hide internal directories.