database

package
v0.0.0-...-a69d58a Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(config models.Config) (*pgxpool.Pool, string, error)

ConnectDB() is used to connect to the database using the configuration values. It initializes the package-level variable DB with the database connection pool. It returns the error as output.

func DeleteMachine

func DeleteMachine(config models.Config, machine_id string, user_id string, owner_type string) error

func DoesUserExists

func DoesUserExists(config models.Config, email string) bool

func GetAMachine

func GetAMachine(config models.Config, machine_id string, user_id string, owner_type string, password string) (models.Machine, error)

func GetAMachineBasicInfo

func GetAMachineBasicInfo(config models.Config, machine_id string, user_id string, owner_type string) (models.FilterMachine, error)

func GetMachines

func GetMachines(config models.Config, user_id string, owner_type string) ([]models.Machine, error)

func GetMachinesBasicInfo

func GetMachinesBasicInfo(config models.Config, user_id string, owner_type string) ([]models.FilterMachine, error)

func GetUsername

func GetUsername(config models.Config, email string) (string, error)

func Migrate

func Migrate(config models.Config) error

func SaveMachine

func SaveMachine(config models.Config, machine models.MachineRequest, username string) error

func SaveUser

func SaveUser(config models.Config, email string, name string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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