api

package
v0.0.0-...-398d8f0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

Main api application that contains database struct

func NewApp

func NewApp(db *sqlx.DB, repos *repository.Repository) *App

func (*App) CreateComment

func (a *App) CreateComment(c *gin.Context)

CreateComment creates new comment for the current user

func (*App) CreatePhoto

func (a *App) CreatePhoto(c *gin.Context)

CreatePhoto creates new photo for the current user

func (*App) CreateSocialMedia

func (a *App) CreateSocialMedia(c *gin.Context)

CreateSocialMedia creates new socialMedia for the current user

func (*App) DeleteComment

func (a *App) DeleteComment(c *gin.Context)

DeleteComment deletes a current user's comment based on its ID

func (*App) DeleteCurrentUser

func (a *App) DeleteCurrentUser(c *gin.Context)

DeleteCurrentUser will delete user data based on currently logged in data

func (*App) DeletePhoto

func (a *App) DeletePhoto(c *gin.Context)

DeletePhoto deletes a current user's photo based on its ID

func (*App) DeleteSocialMedia

func (a *App) DeleteSocialMedia(c *gin.Context)

DeleteSocialMedia deletes a current user's socialMedia based on its ID

func (*App) GetComments

func (a *App) GetComments(c *gin.Context)

GetComments fetches all comments of the current user

func (*App) GetPhotos

func (a *App) GetPhotos(c *gin.Context)

GetPhotos fetches all photos of the current user

func (*App) GetSocialMedias

func (a *App) GetSocialMedias(c *gin.Context)

GetSocialMedias fetches all socialMedias of the current user

func (*App) LoginUser

func (a *App) LoginUser(c *gin.Context)

LoginUser will check the given email and password, and return JWT if successful

func (*App) RegisterUser

func (a *App) RegisterUser(c *gin.Context)

RegisterUser will create a new user

func (*App) UpdateComment

func (a *App) UpdateComment(c *gin.Context)

UpdateComment updates a current user's comment based on its ID

func (*App) UpdatePhoto

func (a *App) UpdatePhoto(c *gin.Context)

UpdatePhoto updates a current user's photo based on its ID

func (*App) UpdateSocialMedia

func (a *App) UpdateSocialMedia(c *gin.Context)

UpdateSocialMedia updates a current user's socialMedia based on its ID

func (*App) UpdateUser

func (a *App) UpdateUser(c *gin.Context)

UpdateUser will update user data based on User ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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