client

package
v0.0.0-...-07119c1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "client"

CollectionName is name of collection

View Source
const DefaultDatabase = "clientbase"

DefaultDatabase is name of database

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	FirstName   string    `json:"firstName" bson:"firstName"`
	LastName    string    `json:"lastName" bson:"lastName"`
	Email       string    `json:"email" bson:"email"`
	PhoneNumber string    `json:"phoneNumber" bson:"phoneNumber"`
	Login       string    `json:"login" bson:"login"`
	Password    string    `json:"password" bson:"password"`
	CreatedOn   time.Time `json:"createdOn" bson:"createdon"`
}

Client contains information about user

type MongoHandler

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

MongoHandler is type of mongoHandler struct

func NewHandler

func NewHandler(address string) *MongoHandler

NewHandler is MongoHandler Constructor

func (*MongoHandler) AddOne

func (mh *MongoHandler) AddOne(c *Client) (*mongo.InsertOneResult, error)

AddOne will add one element to collection

func (*MongoHandler) Get

func (mh *MongoHandler) Get(filter interface{}) []*Client

Get will get all elements from collection

func (*MongoHandler) GetOne

func (mh *MongoHandler) GetOne(c *Client, filter interface{}) error

GetOne will get one element from collection

func (*MongoHandler) RemoveOne

func (mh *MongoHandler) RemoveOne(filter interface{}) (*mongo.DeleteResult, error)

RemoveOne will remove one element from collection

func (*MongoHandler) Update

func (mh *MongoHandler) Update(c *Client, filter interface{}, update interface{}) (*mongo.UpdateResult, error)

Update will update information in collection

Jump to

Keyboard shortcuts

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