db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func CreateMediaFile

func CreateMediaFile(file *MediaFile) (int, error)

func CreateUser

func CreateUser(user *User) (int, error)

CreateUser

func DeleteMediaFile

func DeleteMediaFile(id int) error

func DeleteUser

func DeleteUser(id int) error

DeleteUser

func InitDB

func InitDB(databaseUrl string)

func UpdateMediaFile

func UpdateMediaFile(id int, file *MediaFile) error

func UpdateUser

func UpdateUser(id int, updatedUser *User) error

UpdateUser

Types

type MediaFile

type MediaFile struct {
	ID                int              `json:"id"`
	FilePath          string           `json:"file_path"`
	FileType          string           `json:"file_type"`
	CreationDatetime  pgtype.Timestamp `json:"creation_datetime"` // Adjust type if needed
	EmbeddingsCreated bool             `json:"embeddings_created"`
	Latitude          string           `json:"latitude"` // Using sql.NullFloat64 for optional fields
	Longitude         string           `json:"longitude"`
	Duration          string           `json:"duration"`
	Image             string           `json:"image"`
	Thumbnail         string           `json:"thumbnail,omitempty"`
}

func GetAllMediaFiles

func GetAllMediaFiles(limit, offset int) ([]MediaFile, error)

func GetMediaFileByID

func GetMediaFileByID(id int) (*MediaFile, error)

type User

type User struct {
	Id          int    `json:"id"`
	Email       string `json:"email"`
	Is_active   bool   `json:"is_active"`
	Profile_pic string `json:"picture"`
	Name        string `json:"name"`
}

func GetAllUsers

func GetAllUsers(limit int, offset int) ([]User, error)

GetAllUsers (You might want to add limit and offset to this later)

func GetUserByID

func GetUserByID(id int) (*User, error)

GetUserByID

Jump to

Keyboard shortcuts

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