handler

package
v0.0.0-...-d4b65f6 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNamesToPMs

func AddNamesToPMs(pms []models.PM, m *Repository) ([]models.PM, error)

func AttachFile

func AttachFile(m *Repository, w http.ResponseWriter, r *http.Request, post *models.Post, thread *models.Thread) error

AttachFile attaches a file to a post or thread.

func GoogleGetUserProfile

func GoogleGetUserProfile(access_token string, w http.ResponseWriter, r *http.Request) (user models.User, err error)

func NewHandlers

func NewHandlers(r *Repository)

NewHandlers sets the repository for the handlers

func ShortenerOfSubject

func ShortenerOfSubject(input string) string

shortenerOfSubject helper function to squeeze theme name

Types

type Repository

type Repository struct {
	App *config.AppConfig
	DB  repository.DatabaseInt
}

Repository handles the repository type, encapsulating the AppConfig and DatabaseInt dependencies.

var Repo *Repository

Repo the repository used by the handlers

func NewRepo

func NewRepo(a *config.AppConfig, db *repository.DataBase) *Repository

NewRepo creates a new repository

func (*Repository) CallbackGitHubHandler

func (m *Repository) CallbackGitHubHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) CallbackGoogleHandler

func (m *Repository) CallbackGoogleHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) ChangeUserTypeResultHandler

func (m *Repository) ChangeUserTypeResultHandler(w http.ResponseWriter, r *http.Request)

ChangeUserTypeResultHandler handles changing of user type

func (*Repository) ContactUsHandler

func (m *Repository) ContactUsHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) CreatePostResultHandler

func (m *Repository) CreatePostResultHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) DeletePostHandler

func (m *Repository) DeletePostHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) EditPostHandler

func (m *Repository) EditPostHandler(w http.ResponseWriter, r *http.Request)

RegisterHandler handles both GET and POST requests for the registration page.

func (*Repository) EditPostResultHandler

func (m *Repository) EditPostResultHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) EditTopicHandler

func (m *Repository) EditTopicHandler(w http.ResponseWriter, r *http.Request)

RegisterHandler handles both GET and POST requests for the registration page.

func (*Repository) EditTopicResultHandler

func (m *Repository) EditTopicResultHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) ErrorPage

func (m *Repository) ErrorPage(w http.ResponseWriter, r *http.Request)

ErrorPage handles the "/error-page" route

func (*Repository) ForumRulesHandler

func (m *Repository) ForumRulesHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) GetAllLikedPostsByUserIDHandler

func (m *Repository) GetAllLikedPostsByUserIDHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) GetAllPostsForUserHandler

func (m *Repository) GetAllPostsForUserHandler(w http.ResponseWriter, r *http.Request)

GetAllPostsForUserHandler gets all posts from user (user id)

func (*Repository) GetAllThreadsForUserHandler

func (m *Repository) GetAllThreadsForUserHandler(w http.ResponseWriter, r *http.Request)

GetAllThreadsForUserHandler gets all threads from user (user id)

func (*Repository) GetLoggedUser

func (m *Repository) GetLoggedUser(w http.ResponseWriter, r *http.Request) int

func (*Repository) HelpHandler

func (m *Repository) HelpHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) HomeHandler

func (m *Repository) HomeHandler(w http.ResponseWriter, r *http.Request)

HomeHandler handles both GET and POST requests for the home page.

func (*Repository) LoginHandler

func (m *Repository) LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler handles both GET and POST requests for the login page.

func (*Repository) LoginWithGitHubHandler

func (m *Repository) LoginWithGitHubHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) LoginWithGoogleHandler

func (m *Repository) LoginWithGoogleHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) ModerPanelHandler

func (m *Repository) ModerPanelHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) PersonaCabinetHandler

func (m *Repository) PersonaCabinetHandler(w http.ResponseWriter, r *http.Request)

PersonaCabinetHandler hanles the personal cabinet of selected user.

func (*Repository) PrivatPolicyHandler

func (m *Repository) PrivatPolicyHandler(w http.ResponseWriter, r *http.Request)

func (*Repository) RegisterHandler

func (m *Repository) RegisterHandler(w http.ResponseWriter, r *http.Request)

RegisterHandler handles both GET and POST requests for the registration page.

func (*Repository) SendPMHandler

func (m *Repository) SendPMHandler(w http.ResponseWriter, r *http.Request)

SendPMHandler hanles sending of personal message.

func (*Repository) ThemeHandler

func (m *Repository) ThemeHandler(w http.ResponseWriter, r *http.Request)

ThemeHandler handles the main functionality of the theme page.

Jump to

Keyboard shortcuts

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