pasetobd

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 9 Imported by: 0

README

https://github.com/serbaevents/pasetobd/tree/main 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash added in v0.0.2

func CheckPasswordHash(password, hash string) bool

func GCFPostHandler added in v0.0.2

func GCFPostHandler(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFReturnStruct added in v0.0.2

func GCFReturnStruct(DataStuct any) string

func HashPassword added in v0.0.2

func HashPassword(password string) (string, error)

func InsertUser added in v0.0.2

func InsertUser(db *mongo.Database, collection string, userdata User) string

func IsPasswordValid added in v0.0.2

func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool

func SetConnection added in v0.0.2

func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database

Types

type Credential

type Credential struct {
	Status  bool   `json:"status" bson:"status"`
	Token   string `json:"token,omitempty" bson:"token,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

type User added in v0.0.2

type User struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Username string             `json:"username" bson:"username"`
	Password string             `json:"password" bson:"password"`
}

Jump to

Keyboard shortcuts

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