Documentation ¶
Index ¶
- func CompareHashPass(password, hash string) bool
- func CreateNewReport(mongoconn *mongo.Database, collection string, reportdata Report) interface{}
- func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateReport(mongoconn *mongo.Database, collection string, reportdata Report) interface{}
- func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, ...) error
- func DeleteOneDoc(_id primitive.ObjectID, db *mongo.Database, col string) error
- func DeleteReport(mongoconn *mongo.Database, collection string, reportdata Report) interface{}
- func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func GCFDeleteReport(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, ...) string
- func GCFGetAllReport(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GCFGetAllReportID(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GCFInsertReport(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, ...) string
- func GCFReturnStruct(DataStuct any) string
- func GetAllDocs(db *mongo.Database, col string, docs interface{}) interface{}
- 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 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
- func UpdateOneDoc(id primitive.ObjectID, db *mongo.Database, col string, doc interface{}) (err error)
- func UpdatedReport(mongoconn *mongo.Database, collection string, filter bson.M, reportdata Report) interface{}
- type Credential
- type Payload
- type Report
- type Response
- type ResponseDataUser
- type ResponseEncode
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHashPass ¶
func CreateNewReport ¶
Report
func CreateNewUserRole ¶
User
func CreateReport ¶
Report function
func CreateUser ¶
func CreateUserAndAddToken ¶
func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error
user
func DeleteReport ¶
func DeleteUser ¶
func GCFDeleteReport ¶
func GCFDeleteReport(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, r *http.Request) string
delete report
func GCFGetAllReport ¶
get all report
func GCFGetAllReportID ¶
get all report by id
func GCFInsertReport ¶
func GCFInsertReport(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, r *http.Request) string
Insert Report post
func GetAllDocs ¶
crud
func InsertOneDoc ¶
func InsertUserdata ¶
func IsPasswordValid ¶
func MongoCreateConnection ¶
func ReturnStringStruct ¶
func SetConnection ¶
func UpdateOneDoc ¶
Types ¶
type Credential ¶
type Payload ¶
type Payload struct { Id primitive.ObjectID `json:"id"` User string `json:"user"` Report string `json:"report"` Role string `json:"role"` Exp time.Time `json:"exp"` Iat time.Time `json:"iat"` Nbf time.Time `json:"nbf"` }
func IsTokenValid ¶
<--- paseto encoder ---> memeriksa token
type Report ¶
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 ResponseDataUser ¶
type ResponseEncode ¶
type User ¶
type User struct { Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` 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.