database

package
v0.0.0-...-bc94d4c Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func (*DB) Authenticate

func (d *DB) Authenticate(login *models.LoginModel) (*models.Session, error)

func (*DB) AutoMigrate

func (d *DB) AutoMigrate(model ...interface{}) error

func (*DB) CheckSession

func (d *DB) CheckSession(sessionIDValue string) (*models.Session, error)

func (*DB) Connect

func (d *DB) Connect()

func (*DB) Deauthenticate

func (d *DB) Deauthenticate(sessionID string) error

func (*DB) DeleteImage

func (d *DB) DeleteImage(imgPath string) error

func (*DB) GeneratePasswordResetRequest

func (d *DB) GeneratePasswordResetRequest(userName string) string

GeneratePasswordResetRequest CLI ONLY FUNCTION!

func (*DB) GetGroupsForUser

func (d *DB) GetGroupsForUser(userID string) ([]models.Group, error)

func (*DB) GetSelectableUsersToShareList

func (d *DB) GetSelectableUsersToShareList(session *models.Session, wishlistID string) ([]models.SearchUser, error)

Returns all users as SearchUser slice, minus those that are already shared and the current session user

func (*DB) GetSharedWishlists

func (d *DB) GetSharedWishlists(session *models.Session) ([]models.Wishlist, error)

func (*DB) GetUsersForWishlist

func (d *DB) GetUsersForWishlist(wishlistID string) ([]models.SearchUser, error)

func (*DB) GroupCreate

func (d *DB) GroupCreate(group *models.Group) (string, error)

func (*DB) GroupDelete

func (d *DB) GroupDelete(id string) (string, error)

func (*DB) GroupUpdate

func (d *DB) GroupUpdate(group *models.Group) error

func (*DB) ListObjects

func (d *DB) ListObjects(objectType string) string

ListObjects CLI ONLY FUNCTION!

func (*DB) PasswordResetCLI

func (d *DB) PasswordResetCLI(userName string, password string) string

PasswordResetCLI CLI ONLY FUNCTION!

func (*DB) Register

func (d *DB) Register(user *models.User) error

func (*DB) ReserveWishlistItem

func (d *DB) ReserveWishlistItem(session *models.Session, wlItem *models.WishlistItem) error

func (*DB) RetrieveProfile

func (d *DB) RetrieveProfile(session *models.Session) (*models.ProfileUser, error)

func (*DB) SetUsersForWishlist

func (d *DB) SetUsersForWishlist(wishlistID string, users []models.User) error

func (*DB) UnreserveWishlistItem

func (d *DB) UnreserveWishlistItem(session *models.Session, wlItem *models.WishlistItem) error

func (*DB) UploadImage

func (d *DB) UploadImage(formFile multipart.File, fileHeader *multipart.FileHeader, table string) (string, error)

UploadImage provide a formfile (from upload), its fileheadder, and the name of the table/folder to store the file. returns the file path of the stored file and any error

func (*DB) ValidateAndResetUser

func (d *DB) ValidateAndResetUser(resetToken string, password string) error

func (*DB) WishlistBrowse

func (d *DB) WishlistBrowse(session *models.Session) ([]models.Wishlist, error)

func (*DB) WishlistDelete

func (d *DB) WishlistDelete(id string) (string, error)

func (*DB) WishlistRetrieveAll

func (d *DB) WishlistRetrieveAll(session *models.Session) ([]models.Wishlist, error)

func (*DB) WishlistRetrieveOne

func (d *DB) WishlistRetrieveOne(session *models.Session, id string) (*models.Wishlist, error)

func (*DB) WishlistUpsert

func (d *DB) WishlistUpsert(wishlist *models.Wishlist) (string, error)

Jump to

Keyboard shortcuts

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