database

package
v0.0.0-...-a3ed9dc Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Conn *mongo.Client
}

func InitDB

func InitDB(ctx context.Context) *Client

func (Client) AddCompany

func (m Client) AddCompany(company *models.Company) (*models.Company, error)

func (Client) DeleteCompany

func (m Client) DeleteCompany(id string) error

func (Client) GetCompanyByID

func (m Client) GetCompanyByID(id string) (*models.Company, error)

func (*Client) GetMongoCompanyCollection

func (m *Client) GetMongoCompanyCollection() *mongo.Collection

func (*Client) GetMongoDatabase

func (m *Client) GetMongoDatabase() *mongo.Database

func (*Client) GetMongoUserCollection

func (m *Client) GetMongoUserCollection() *mongo.Collection

func (Client) GetUserFromEmail

func (m Client) GetUserFromEmail(email string) (*models.User, error)

func (*Client) InitIndices

func (m *Client) InitIndices() error

func (Client) UpdateCompany

func (m Client) UpdateCompany(id string, companyUpdate *models.CompanyUpdate) (*models.Company, error)

func (Client) UserLogin

func (m Client) UserLogin(loginInfo *models.UserLogin) (string, error)

func (Client) UserSignup

func (m Client) UserSignup(user *models.User) (*models.User, error)

Jump to

Keyboard shortcuts

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