db

package
v0.0.0-...-f88e32e Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Db es una variable global que mantendrá la conexión a la base de datos
	Db *sql.DB
)

Functions

func CloseDB

func CloseDB()

CloseDB cierra la conexión a la base de datos

func DeletePost

func DeletePost(postID int) error

func FindPostByID

func FindPostByID(postID string) (*models.Post, error)

func FindPostsByCategory

func FindPostsByCategory(categoria string) ([]*models.Post, error)

func GetAllPosts

func GetAllPosts() ([]*models.Post, error)

func GetUserByUsername

func GetUserByUsername(username string) (*models.User, error)

func InitDB

func InitDB()

InitDB inicializa la conexión a la base de datos

func InsertPost

func InsertPost(post *models.Post) error

func InsertUser

func InsertUser(user *models.User) error

func UpdatePost

func UpdatePost(postID int, post *models.Post) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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