db

package
v0.0.0-...-396de1d Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 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 GetAllEducation

func GetAllEducation() ([]models.Education, error)

func GetAllExperiences

func GetAllExperiences() ([]models.Experience, error)

func GetAllPosts

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

func GetAllProjects

func GetAllProjects() ([]models.Project, error)

func GetAllVisits

func GetAllVisits() ([]models.Visit, error)

GetAllVisits obtiene las últimas visitas

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 InsertVisit

func InsertVisit(visit *models.Visit) error

InsertVisit guarda una visita en la base de datos

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