database

package
v0.0.0-...-005ecf2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserLogin

func CheckUserLogin(username, password string) (bool, error)

func CreateAlbum

func CreateAlbum(shortcode, name, description string, createdby int, public bool) error

func CreateFile

func CreateFile(filename, originalFilename, hash string, createdby int) error

func CreateUser

func CreateUser(username, password string) error

func DeleteAlbum

func DeleteAlbum(id int) error

func GetAlbumFileCount

func GetAlbumFileCount(id int) (int, error)

func OpenDB

func OpenDB()

func UpdateUser

func UpdateUser(id int, user User) error

Types

type Album

type Album struct {
	ID          int
	Shortcode   string
	Name        string
	Description string
	CreatedAt   time.Time
	CreatedBy   int
	Public      bool
}

func GetAlbumByShortcode

func GetAlbumByShortcode(code string) (Album, error)

func GetAlbumsByUser

func GetAlbumsByUser(id, limit, offset int) ([]Album, error)

type File

type File struct {
	ID               int
	Filename         string
	OriginalFilename string
	CreatedAt        int64
	CreatedBy        int
	Hash             string
}

func GetFileByHash

func GetFileByHash(hash string) (File, error)

func GetFileByID

func GetFileByID(id int) (File, error)

func GetFileByName

func GetFileByName(filename string) (File, error)

func GetFilesByUser

func GetFilesByUser(userid, limit, offset int) ([]File, error)

type User

type User struct {
	ID       int
	Username string
	Password string
}

func GetUserByID

func GetUserByID(id int) (User, error)

func GetUserByUsername

func GetUserByUsername(username string) (User, error)

Jump to

Keyboard shortcuts

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