Documentation
¶
Index ¶
- func ErrorResponse(w http.ResponseWriter, code int, err error)
- func GetJwt(signerClaims Credentials) (tokenString string, expireTime time.Time, err error)
- func RefreshJwt(w http.ResponseWriter, r *http.Request)
- func ResponseJson(w http.ResponseWriter, code int, payload interface{})
- type Claims
- type Credentials
- type DBUserResponse
- type DbUserFullSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, code int, err error)
func GetJwt ¶
func GetJwt(signerClaims Credentials) (tokenString string, expireTime time.Time, err error)
func RefreshJwt ¶
func RefreshJwt(w http.ResponseWriter, r *http.Request)
func ResponseJson ¶
func ResponseJson(w http.ResponseWriter, code int, payload interface{})
Types ¶
type Claims ¶
type Claims struct { Creds Credentials jwt.RegisteredClaims }
type Credentials ¶
type DBUserResponse ¶
type DBUserResponse struct { ID uuid.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` Bio sql.NullString `json:"bio"` }
func MapLoginUser ¶
func MapLoginUser(dbUser database.User) DBUserResponse
type DbUserFullSchema ¶
type DbUserFullSchema struct { ID uuid.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` Bio sql.NullString `json:"bio"` Isadmin bool `json:"is_admin"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func MapRegisteredUser ¶
func MapRegisteredUser(dbUser database.User) DbUserFullSchema
Click to show internal directories.
Click to hide internal directories.