controllers

package
v0.0.0-...-d92368f Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthenticated

func IsAuthenticated() gin.HandlerFunc

Checks if user is logged in

Types

type Controller

type Controller struct {
	Database *gorm.DB
}

func New

func New() *Controller

func (*Controller) CreateAnswer

func (con *Controller) CreateAnswer(c *gin.Context)

Create answer

func (*Controller) CreateQuestion

func (con *Controller) CreateQuestion(c *gin.Context)

func (*Controller) GetAllQuestions

func (con *Controller) GetAllQuestions(c *gin.Context)

func (*Controller) GetAnswer

func (con *Controller) GetAnswer(c *gin.Context)

Get answer

func (*Controller) GetAnswers

func (con *Controller) GetAnswers(c *gin.Context)

Get answers

func (*Controller) GetQuestion

func (con *Controller) GetQuestion(c *gin.Context)

func (*Controller) GetQuestionsQuery

func (con *Controller) GetQuestionsQuery(c *gin.Context)

func (*Controller) Login

func (con *Controller) Login(c *gin.Context)

Creates session for user

func (*Controller) Logout

func (con *Controller) Logout(c *gin.Context)

func (*Controller) Register

func (con *Controller) Register(c *gin.Context)

Registers user

func (*Controller) UpdateQuestion

func (con *Controller) UpdateQuestion(c *gin.Context)

Jump to

Keyboard shortcuts

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