controllers

package
v0.0.0-...-18e2de5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Roles []string = []string{"SUPERUSER", "ADMIN", "EDITOR"}

Functions

func AddAdmin

func AddAdmin(c *fiber.Ctx) error

func AddUploadCoverPic

func AddUploadCoverPic(c *fiber.Ctx) error

func AddUploadProfilePic

func AddUploadProfilePic(c *fiber.Ctx) error

func DeleteCoverPic

func DeleteCoverPic(c *fiber.Ctx) error

func DeleteProfilePic

func DeleteProfilePic(c *fiber.Ctx) error

func GenerateJWT

func GenerateJWT(userDetails models.User, ExpiresAt *jwt.NumericDate, IssuedAt *jwt.NumericDate) (string, error)

func GetAdmins

func GetAdmins(c *fiber.Ctx) error

func GetCoverPic

func GetCoverPic(c *fiber.Ctx) error

func GetProfile

func GetProfile(c *fiber.Ctx) error

func GetProfilePic

func GetProfilePic(c *fiber.Ctx) error

func GetPublicCoverPicById

func GetPublicCoverPicById(c *fiber.Ctx) error

func GetPublicProfilePicById

func GetPublicProfilePicById(c *fiber.Ctx) error

func GetUserFromToken

func GetUserFromToken(token string) (models.User, error)

func IsValidRole

func IsValidRole(role string) bool

func Login

func Login(c *fiber.Ctx) error

func Register

func Register(c *fiber.Ctx) error

Register endpoint

func UpdateProfileDetails

func UpdateProfileDetails(c *fiber.Ctx) error

Types

type CustomClaims

type CustomClaims struct {
	UserId   string `json:"user_id"`
	FindName string `json:"Find_name"`
	LastName string `json:"last_name"`
	Gender   string `json:"gender"`
	// BirthDate    string               `json:"birth_date"`
	UserName string `json:"user_name"`
	// MobileNo     string               `json:"mobile_no"`
	// EmailID      string               `json:"email_id"`
	ProfileImage *models.ProfileImage `json:"profile_image"`
	CoverImage   *models.CoverImage   `json:"cover_image"`
	jwt.RegisteredClaims
}

func VerifyJWT

func VerifyJWT(tokenString string) (*CustomClaims, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL