Documentation ¶
Index ¶
- func CompareHashPass(password, hash string) bool
- func CreateAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func CreateAdminAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, ...) error
- func CreateNewAdminRole(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func CreateNewReport(mongoconn *mongo.Database, collection string, reportdata Report) interface{}
- func CreateNewTanggapan(mongoconn *mongo.Database, collection string, tanggapandata Tanggapan) interface{}
- func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateNewUserRoleNew(mongoconn *mongo.Database, collection string, userdata UserNew) 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 DecodeGetReport(PublicKey, tokenStr string) (pay string, err error)
- func DecodeGetRole(publickey string, tokenstring string) string
- func DecodeGetUser(PublicKey, tokenStr string) (pay string, err error)
- func DecodeGetUsername(publickey string, tokenstring string) string
- func DeleteOneDoc(_id primitive.ObjectID, db *mongo.Database, col string) error
- func DeleteReport(mongoconn *mongo.Database, collection string, reportdata Report) interface{}
- func DeleteTanggapan(mongoconn *mongo.Database, collection string, tanggapandata Tanggapan) interface{}
- func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func Deleteuser(mongoconn *mongo.Database, collection string, userdata2 UserNew) interface{}
- func EditUser(mongoenv *mongo.Database, collname string, datauser UserNew) interface{}
- func GCFDeleteReportForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collreport string, ...) string
- func GCFDeleteUserForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, colluser string, ...) string
- func GCFFindUserByName(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) 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 GCFInsertTanggapan(publickey, MONGOCONNSTRINGENV, dbname, colladmin, colltanggapan string, ...) string
- func GCFReturnStruct(DataStuct any) string
- func GCFUpdateReportForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collreport string, ...) string
- func GCFUpdateReportForUser(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, ...) string
- func GCFUpdateUserForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, colluser string, ...) string
- func GCFUpdateUserForUser(publickey, MONGOCONNSTRINGENV, dbname, colluser string, r *http.Request) string
- func GetAllDataReports(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func GetAllDataUser(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func GetAllDocs(db *mongo.Database, col string, docs interface{}) interface{}
- func GetOneDataReport(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GetOneDataReports(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GetOneDataUser(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GetOneTanggapan(mongoconn *mongo.Database, collection string, tanggapandata Tanggapan) interface{}
- func HashPass(password string) (string, error)
- func InsertAdmindata(MongoConn *mongo.Database, username, role, password string) (InsertedID interface{})
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func InsertUserdata(MongoConn *mongo.Database, username, role, password string) (InsertedID interface{})
- func InsertUserdataNew(MongoConn *mongo.Database, username, notelp, role, password string) (InsertedID interface{})
- func IsExist(Tokenstr, PublicKey string) bool
- func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool
- func IsPasswordValidAdmin(mongoconn *mongo.Database, collection string, admindata Admin) bool
- func IsPasswordValidUserNew(mongoconn *mongo.Database, collection string, userdata2 UserNew) bool
- func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func LoginAdmin(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func LoginUserNew(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 RegisterNew(Mongoenv, dbname string, r *http.Request) string
- func ReturnStringStruct(Data any) string
- func ReturnStruct(DataStuct any) string
- func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database
- func UpdateOneDoc(id primitive.ObjectID, db *mongo.Database, col string, doc interface{}) (err error)
- func UpdateUserByUser(publickey, mongoenv, dbname, collname string, r *http.Request) string
- func UpdatedReport(mongoconn *mongo.Database, collection string, filter bson.M, reportdata Report) interface{}
- func UpdatedTanggapan(mongoconn *mongo.Database, collection string, filter bson.M, ...) interface{}
- func UpdatedUser(mongoconn *mongo.Database, collection string, filter bson.M, userdata2 UserNew) interface{}
- type Admin
- type Contact
- type Credential
- type Payload
- type Report
- func FindOneReport(mongoconn *mongo.Database, collection string, reportdata Report) Report
- func FindReport(mongoconn *mongo.Database, collection string, reportdata Report) Report
- func GetAllReport(mongoconn *mongo.Database, collection string) []Report
- func GetAllReportID(mongoconn *mongo.Database, collection string, reportdata Report) Report
- func GetOneReport(mongoconn *mongo.Database, collection string, reportdata Report) Report
- func GetOneReportData(mongoconn *mongo.Database, collname string, reportdata Report) Report
- func GetOneReportNik(mongoconn *mongo.Database, collection string, reportdata Report) Report
- func GetReportFromID(db *mongo.Database, col string, _id primitive.ObjectID) (*Report, error)
- func GetReportFromIDs(db *mongo.Database, col string, _id int) (*Report, error)
- type Response
- type ResponseDataUser
- type ResponseEncode
- type Tanggapan
- type User
- type UserNew
- func FindUserNew(mongoconn *mongo.Database, collection string, userdata UserNew) UserNew
- func FindUserNews(mongoenv *mongo.Database, collname string, userdata UserNew) UserNew
- func GetAllUser(mongoconn *mongo.Database, collection string) []UserNew
- func GetUserFromID(db *mongo.Database, col string, _id primitive.ObjectID) (*UserNew, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHashPass ¶
func CreateAdmin ¶ added in v0.0.7
func CreateAdminAndAddToken ¶ added in v0.0.7
func CreateAdminAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, admindata Admin) error
admin
func CreateNewAdminRole ¶ added in v0.0.7
Admin
func CreateNewReport ¶
Report
func CreateNewTanggapan ¶ added in v0.1.1
func CreateNewTanggapan(mongoconn *mongo.Database, collection string, tanggapandata Tanggapan) interface{}
Tanggapan
func CreateNewUserRole ¶
User
func CreateNewUserRoleNew ¶ added in v0.1.9
func CreateReport ¶ added in v0.0.3
Report function
func CreateUser ¶
func CreateUserAndAddToken ¶
func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error
user
func DecodeGetReport ¶ added in v0.0.8
func DecodeGetRole ¶ added in v0.3.4
func DecodeGetUser ¶ added in v0.1.5
func DecodeGetUsername ¶ added in v0.3.4
func DeleteReport ¶
func DeleteTanggapan ¶ added in v0.1.1
func DeleteUser ¶
func Deleteuser ¶ added in v0.2.6
func GCFDeleteReportForAdmin ¶ added in v0.0.9
func GCFDeleteReportForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collreport string, r *http.Request) string
Delete Report For Admin
func GCFDeleteUserForAdmin ¶ added in v0.2.6
func GCFFindUserByName ¶ added in v0.2.2
func GCFGetAllReport ¶
get all report
func GCFGetAllReportID ¶
get all report by Nik
func GCFInsertReport ¶
func GCFInsertReport(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, r *http.Request) string
Insert Report post
func GCFInsertTanggapan ¶ added in v0.1.1
func GCFUpdateReportForAdmin ¶ added in v0.0.9
func GCFUpdateReportForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collreport string, r *http.Request) string
Update report for admin
func GCFUpdateReportForUser ¶ added in v0.3.6
func GCFUpdateReportForUser(publickey, MONGOCONNSTRINGENV, dbname, colluser, collreport string, r *http.Request) string
Update report for User
func GCFUpdateUserForAdmin ¶ added in v0.2.6
func GCFUpdateUserForAdmin(publickey, MONGOCONNSTRINGENV, dbname, colladmin, colluser string, r *http.Request) string
Update data user for admin
func GCFUpdateUserForUser ¶ added in v0.3.3
func GCFUpdateUserForUser(publickey, MONGOCONNSTRINGENV, dbname, colluser string, r *http.Request) string
Update data user for User
func GetAllDataReports ¶ added in v0.0.8
Get All data report For Admin
func GetAllDataUser ¶ added in v0.1.5
GetAllUser
func GetAllDocs ¶
crud
func GetOneDataReport ¶ added in v0.2.8
func GetOneDataReports ¶ added in v0.3.0
func GetOneDataUser ¶ added in v0.3.1
Get satu data User
func GetOneTanggapan ¶ added in v0.1.1
func InsertAdmindata ¶ added in v0.0.7
func InsertOneDoc ¶
func InsertUserdata ¶
func InsertUserdataNew ¶ added in v0.1.7
func IsPasswordValid ¶
func IsPasswordValidAdmin ¶ added in v0.0.7
func IsPasswordValidUserNew ¶ added in v0.1.7
func LoginAdmin ¶ added in v0.0.7
Function Admin
func LoginUserNew ¶ added in v0.1.7
func MongoCreateConnection ¶
func RegisterNew ¶ added in v0.1.7
func ReturnStringStruct ¶
func ReturnStruct ¶ added in v0.3.4
func SetConnection ¶
func UpdateOneDoc ¶
func UpdateUserByUser ¶ added in v0.3.4
func UpdatedReport ¶
func UpdatedTanggapan ¶ added in v0.1.1
Types ¶
type Admin ¶ added in v0.0.7
type Admin 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"` }
type Contact ¶
type Contact struct { ID int `json:"id" bson:"id"` Name string `json:"title" bson:"title"` Subject string `json:"description" bson:"description"` Alamat string `json:"alamat" bson:"alamat"` Website string `json:"website" bson:"website"` Message string `json:"image" bson:"image"` Email string `json:"email" bson:"email"` Phone string `json:"phone" bson:"phone"` Status bool `json:"status" bson:"status"` }
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"` Data []Report `bson:"data,omitempty" json:"data,omitempty"` Datas []UserNew `bson:"datas,omitempty" json:"datas,omitempty"` }
type Payload ¶
type Payload struct { Id primitive.ObjectID `json:"id"` Admin string `json:"admin"` User string `json:"user"` UserNew string `json:"usernew` Username string `json:"username` Tanggapan string `json:"tanggapan"` Report string `json:"report"` Role string `json:"role"` Exp time.Time `json:"exp"` Iat time.Time `json:"iat"` Nbf time.Time `json:"nbf"` }
type Report ¶
type Report struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` Nik int `json:"nik" bson:"nik" json:"nik,omitempty` Nama string `json:"nama" bson:"nama" json:"nama,omitempty` Title string `json:"title" bson:"title" json:"title,omitempty` Description string `json:"description" bson:"description" json:"description,omitempty` DateOccurred string `json:"dateOccurred" bson:"dateOccured" json:"dataOccurred,omitempty` Image string `json:"image" bson:"image" json:"image,omitempty` Tanggapan string `json:"tanggapan" bson:"tanggapan" json:"tanggapan,omitempty` Status bool `json:"status" bson:"status" json:"status,omitempty` PihakTerkait string `json:"pihakterkait" bson:"pihakterkait" json:"pihakterkait,omitempty` }
func FindOneReport ¶ added in v0.2.6
func FindReport ¶ added in v0.2.0
func GetAllReportID ¶
func GetOneReport ¶ added in v0.2.0
func GetOneReportData ¶ added in v0.1.9
func GetOneReportNik ¶ added in v0.2.2
func GetReportFromID ¶ added in v0.2.8
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 Tanggapan ¶ added in v0.1.1
type Tanggapan struct { ID primitive.ObjectID `bson:"_id,omitempty"` Nik int `json:"nik" bson:"nik"` Description string `json:"description"` DateRespons string `json:"daterespons"` }
func GetAllTanggapan ¶ added in v0.1.1
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"` }
func FindUserUser ¶ added in v0.2.2
type UserNew ¶ added in v0.1.7
type UserNew struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` Username string `json:"username" bson:"username,omitempty"` Password string `json:"password" bson:"password,omitempty"` Notelp string `json:"notelp" bson:"notelp,omitempty"` 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"` }
func FindUserNew ¶ added in v0.3.3
func FindUserNews ¶ added in v0.3.4
func GetAllUser ¶ added in v0.1.5
Source Files ¶
Click to show internal directories.
Click to hide internal directories.