database

package
v0.0.0-...-0444a63 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRecord

func CreateRecord(bucketName string, record interface{}) error

CreateRecord creates a record in the database for the given item/user after encrypting the content.

func DeleteRecord

func DeleteRecord(bucketName, id string) error

func GetAllItemTitles

func GetAllItemTitles(bucketName string, records interface{}) error

GetAllRecords retrieves all records from the specified bucket and unmarshals them into the provided slice.

func GetAllRecords

func GetAllRecords(bucketName string, records interface{}) error

GetAllRecords retrieves all records from the specified bucket and unmarshals them into the provided slice.

func GetItemByField

func GetItemByField(field string, value string) (*models.Item, error)

getUserByField retrieves a user by a specific field (e.g., username or wallet) from the database

func GetItemByTitle

func GetItemByTitle(title string) (*models.Item, error)

func GetRecordByID

func GetRecordByID(bucketName, id string, record interface{}) error

GetRecordByID retrieves a record from the specified bucket by ID and unmarshals it into the provided model.

func GetUserByField

func GetUserByField(field string, value string) (*models.User, error)

getUserByField retrieves a user by a specific field (e.g., username or wallet) from the database

func GetUserByUsername

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

GetUserByUsername retrieves a user by username from the database

func GetUserByWallet

func GetUserByWallet(wallet string) (*models.User, error)

GetUserByWallet retrieves a user by wallet address from the database

func Initialize

func Initialize(c config.Server) error

func NextID

func NextID(bucketName string) (int, error)

func UpdateRecord

func UpdateRecord(bucketName, id string, updatedRecord interface{}) error

UpdateRecord updates a record in the specified bucket with the provided ID and updated data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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