models

package
v0.0.0-...-1f8323c Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConn *gorm.DB
View Source
var ErrNoDocuments = mongo.ErrNoDocuments

Functions

func Connect

func Connect() error

func DeleteUser

func DeleteUser(c *fiber.Ctx) error

func InitDatabase

func InitDatabase()

Types

type Lead

type Lead struct {
	ID      string  `json:"id,omitempty" bson:"_id,omitempty"`
	Name    string  `json:"name"`
	Capital float64 `json:"capital"`
	Age     uint8   `json:"age"`
}

type MongoInstance

type MongoInstance struct {
	Client *mongo.Client
	Db     *mongo.Database
}
var Mg *MongoInstance

type User

type User struct {
	gorm.Model
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
}

func AddUser

func AddUser(c *fiber.Ctx) (*User, error)

func FetchUser

func FetchUser(c *fiber.Ctx) (*User, error)

func FetchUsers

func FetchUsers(c *fiber.Ctx) ([]User, error)

func UpdateUser

func UpdateUser(c *fiber.Ctx) (*User, error)

Jump to

Keyboard shortcuts

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