controllers

package
v0.0.0-...-f8fb3d8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package controllers contains all the controllers that are used to controll various routes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	H   *initializers.H
	Env *config.Env
}

Auth is a struct containing the Auth controllers

func (*Auth) Logout

func (a *Auth) Logout(c *fiber.Ctx) error

Logout is a function that is used to logout the user from the application

func (*Auth) RefreshToken

func (a *Auth) RefreshToken(c *fiber.Ctx) error

RefreshToken is a function that is used to refresh the access token by providing the refresh token

type Links struct {
	H   *initializers.H
	Env *config.Env
}

Links contains all the operations that are related to links

func (*Links) CheckKey

func (l *Links) CheckKey(c *fiber.Ctx) error

CheckKey is a function that is used to check wether a given key is used previously in the database

func (l *Links) DeleteLink(c *fiber.Ctx) error

DeleteLink is a function to delete a link with a given key

func (l *Links) DeleteLinks(c *fiber.Ctx) error

DeleteLinks is a function that is used to delete all the links that belong to the user

func (l *Links) GetLinks(c *fiber.Ctx) error

GetLinks is a function to get all the links created by the user

func (*Links) New

func (l *Links) New(c *fiber.Ctx) error

New create a new link with the key or without the key

func (*Links) Update

func (l *Links) Update(c *fiber.Ctx) error

Update is a function to update the Link and the Key in the database

func (*Links) UpdateKey

func (l *Links) UpdateKey(c *fiber.Ctx) error

UpdateKey is a function that is used to update the shortned key of the link

func (*Links) UpdateURL

func (l *Links) UpdateURL(c *fiber.Ctx) error

UpdateURL is a function that is used to update the URL of the shortned link that is saved in the datbase

type OAuth

type OAuth struct {
	H   *initializers.H
	Env *config.Env
}

OAuth contains oauth releated controllers

func (*OAuth) GithubOAuthCalback

func (o *OAuth) GithubOAuthCalback(c *fiber.Ctx) error

GithubOAuthCalback is a function that is used by Github to provide a unique code for the user who just tried to login

func (*OAuth) RedirectToGitHubOAuthFlow

func (o *OAuth) RedirectToGitHubOAuthFlow(c *fiber.Ctx) error

RedirectToGitHubOAuthFlow redirect the user to the Github reidrect URL to login with Github

type User

type User struct {
	H   *initializers.H
	Env *config.Env
}

User contains all the user related controllers

func (*User) CheckUsername

func (u *User) CheckUsername(c *fiber.Ctx) error

CheckUsername is a function to check wether the username is availale or not

func (*User) GetMe

func (u *User) GetMe(c *fiber.Ctx) error

GetMe is a function to get the user details of the currently logged in user

func (*User) UpdateEmail

func (u *User) UpdateEmail(c *fiber.Ctx) error

UpdateEmail is a function that is used to update the email of the user

func (*User) UpdateName

func (u *User) UpdateName(c *fiber.Ctx) error

UpdateName is a function to update the name of the user

func (*User) UpdateUsername

func (u *User) UpdateUsername(c *fiber.Ctx) error

UpdateUsername is a function to change the username of the username to another valid username

Jump to

Keyboard shortcuts

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