Documentation ¶
Index ¶
- func CheckEmail(email string) bool
- func CheckPasswordHash(passwordhash, hash string) bool
- func CompareUsername(MongoConn *mongo.Database, Colname, username string) bool
- func CreateAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func DecodeGetNPM(PublicKey, tokenStr string) (pay string, err error)
- func DecodeGetRole(PublicKey, tokenStr string) (pay string, err error)
- func DecodeGetRoleandUser(PublicKey, tokenStr string) (pay string, use string)
- func DecodeGetUser(PublicKey, tokenStr string) (pay string, err error)
- func DeleteDataUser(MongoConn *mongo.Database, colname string, npm string) (*mongo.DeleteResult, error)
- func DeleteOneDoc(_id primitive.ObjectID, db *mongo.Database, col string) error
- func DeleteUser(Mongoenv, publickey, dbname, colname string, r *http.Request) string
- func EncodeWithRole(role, username, privatekey string) (string, error)
- func GCFDeleteDataUser(Mongostring, dbname, colname string, r *http.Request) string
- func GCFReturnStruct(DataStuct any) string
- func GCFUpdateDataUser(Mongostring, 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 GetConnectionMongo(MongoString, dbname string) *mongo.Database
- func GetOneDataUserNPM(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func HashPassword(passwordhash string) (string, error)
- func InsertAdmindata(MongoConn *mongo.Database, ...) (InsertedID interface{})
- func InsertOneDoc(db *mongo.Database, col string, doc interface{}) (insertedID primitive.ObjectID, err error)
- func InsertSatuDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func InsertUserdata(MongoConn *mongo.Database, ...) (InsertedID interface{})
- func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool
- func IsPasswordValidEmail(mongoconn *mongo.Database, collection string, userdata User) bool
- func IsPasswordValidEmailAdmin(mongoconn *mongo.Database, collection string, admindata Admin) bool
- func LoginAdmin(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, ...) string
- func LoginUserEmail(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, ...) string
- func LoginUserNPM(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, ...) string
- func MongoConnect(MongoString, dbname string) *mongo.Database
- func Register(Mongoenv, dbname string, r *http.Request) string
- func RegisterAdmin(Mongoenv, dbname string, r *http.Request) string
- func ReturnStringStruct(Data any) string
- func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database
- func TokenEncoder(username, privatekey string) string
- func UpdateDataUser(MongoConn *mongo.Database, colname, npm, Username, Email, Role string) error
- func UpdateOneDoc(id primitive.ObjectID, db *mongo.Database, col string, doc interface{}) (err error)
- func UpdateUser(Mongoenv, dbname string, r *http.Request) string
- func UpdateUserData(mongoconn *mongo.Database, collection string, filter bson.M, usr User) interface{}
- type Admin
- type Cred
- type Credential
- type Credents
- type EmailValidator
- type Payload
- type RequestUser
- type Response
- type ResponseEncode
- type ResponseGet
- type ResponseUser
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶ added in v0.0.7
func CompareUsername ¶
func CreateAdmin ¶ added in v0.1.0
func CreateUser ¶ added in v0.0.7
< --- FUNCTION USER --->
func DecodeGetNPM ¶ added in v0.2.3
func DecodeGetRole ¶
func DecodeGetRoleandUser ¶
func DecodeGetUser ¶
func DeleteDataUser ¶ added in v0.1.8
func DeleteOneDoc ¶ added in v0.1.4
func DeleteUser ¶ added in v0.0.7
func EncodeWithRole ¶
func GCFDeleteDataUser ¶ added in v0.1.8
func GCFReturnStruct ¶ added in v0.0.7
func GCFUpdateDataUser ¶ added in v0.1.8
func GetAllDataUser ¶ added in v0.2.0
func GetAllDocs ¶ added in v0.1.4
func GetConnectionMongo ¶ added in v0.0.7
func GetOneDataUserNPM ¶ added in v0.2.1
func HashPassword ¶ added in v0.0.7
func InsertAdmindata ¶ added in v0.1.0
func InsertOneDoc ¶
func InsertSatuDoc ¶ added in v0.1.4
dipake
func InsertUserdata ¶
func IsPasswordValid ¶ added in v0.0.7
func IsPasswordValidEmail ¶ added in v0.1.4
func IsPasswordValidEmailAdmin ¶ added in v0.2.6
func LoginAdmin ¶ added in v0.1.4
func LoginUserEmail ¶ added in v0.2.5
func LoginUserNPM ¶ added in v0.2.5
func LoginUserNPM(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
< --- FUNCTION USER --->
func MongoConnect ¶ added in v0.1.4
mongodb
func RegisterAdmin ¶ added in v0.0.7
func ReturnStringStruct ¶
func SetConnection ¶ added in v0.0.7
func TokenEncoder ¶
func UpdateDataUser ¶ added in v0.1.8
func UpdateOneDoc ¶ added in v0.1.4
Types ¶
type Admin ¶ added in v0.0.7
type Admin struct { Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` PasswordHash string `json:"passwordhash" bson:"passwordhash"` Email string `bson:"email,omitempty" json:"email,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"` }
type Credential ¶ added in v0.0.7
type EmailValidator ¶ added in v0.1.4
type EmailValidator struct {
// contains filtered or unexported fields
}
EmailValidator adalah tipe khusus untuk validasi email npm@std.ulbi.ac.id
func NewEmailValidator ¶ added in v0.1.4
func NewEmailValidator() *EmailValidator
func (*EmailValidator) IsValid ¶ added in v0.1.4
func (v *EmailValidator) IsValid(email string) bool
IsValid memeriksa apakah email sesuai dengan pola npm@std.ulbi.ac.id
type Payload ¶
type RequestUser ¶ added in v0.2.4
type RequestUser struct {
NPM string `json:"npm" bson:"npm"`
}
type ResponseEncode ¶
type ResponseGet ¶ added in v0.1.5
type ResponseGet struct {
Token string `json:"token,omitempty" bson:"token,omitempty"`
}
type ResponseUser ¶ added in v0.2.4
type User ¶
type User struct { UsernameId string `json:"usernameid" bson:"usernameid"` Username string `json:"username" bson:"username"` NPM string `json:"npm" bson:"npm"` Password string `json:"password" bson:"password"` PasswordHash string `json:"passwordhash" bson:"passwordhash"` Email string `bson:"email,omitempty" json:"email,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 GetAllUser ¶
dipake
Click to show internal directories.
Click to hide internal directories.