Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func CompareHashPass(password, hash string) bool
- func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, ...) error
- func GCFReturnStruct(DataStruct any) string
- func HashPass(password string) (string, error)
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func InsertUserdata(MongoConn *mongo.Database, username, role, password string) (InsertedID interface{})
- func IsExist(Tokenstr, PublicKey string) bool
- func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool
- func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func MongoCreateConnection(MongoString, dbname string) *mongo.Database
- func Register(Mongoenv, dbname string, r *http.Request) string
- func ReturnStringStruct(Data any) string
- func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database
- type Credential
- type Payload
- type RegisterStruct
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func CompareHashPass ¶
func CreateNewUserRole ¶
user
func CreateUser ¶
user
func CreateUserAndAddToken ¶
func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error
user
func InsertOneDoc ¶
func InsertUserdata ¶
func IsPasswordValid ¶
func MongoCreateConnection ¶
func ReturnStringStruct ¶
func SetConnection ¶
Types ¶
type Credential ¶
type Payload ¶
type RegisterStruct ¶
type Response ¶
type Response struct { Status bool `json:"status" bson:"status"` Message string `json:"message" bson:"message"` Data interface{} `json:"data" bson:"data"` }
func CreateResponse ¶
type User ¶
type User struct { Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` PasswordHash string `json:"passwordhash" bson:"passwordhash"` Role string `json:"role,omitempty" bson:"role,omitempty"` Token string `json:"token,omitempty" bson:"token,omitempty"` Private string `json:"private,omitempty" bson:"private,omitempty"` Public string `json:"public,omitempty" bson:"public,omitempty"` }
Click to show internal directories.
Click to hide internal directories.