Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func CompareNipp(MongoConn *mongo.Database, Colname, nipp string) bool
- 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 DeleteCompromisedAction(mongoconn *mongo.Database, colname, Reportid string) (deletedid interface{}, err error)
- func DeleteCompromisedActionData(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func DeleteDataReport(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func DeleteDataUser(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func DeleteReportData(mongoconn *mongo.Database, colname, Reportid string) (deletedid interface{}, err error)
- func DeleteUser(mongoconn *mongo.Database, colname, Nipp string) (deletedid interface{}, err error)
- func EncodeWithRole(role, nipp, privatekey string) (string, error)
- func FollowUpCompromisedAction(Publickey, MongoEnv, dbname, colname string, r *http.Request) string
- func GCFReturnStruct(DataStuct any) string
- func GetAllCompromisedActions(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string
- func GetAllCompromisedActionsByUser(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string
- func GetAllReport(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string
- func GetAllReportByNipp(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string
- func GetAllUserData(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func GetDataUser(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func GetOneCompromisedAction(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func GetOneReport(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func HashPassword(password string) (string, error)
- func InsertCompromisedAction(Publickey, MongoEnv, dbname, colname string, r *http.Request) string
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func InsertReportAction(MongoConn *mongo.Database, colname string, rpt ReportUnsafeAction) (InsertedID interface{})
- func InsertReportCompromised(MongoConn *mongo.Database, colname string, rpt ReportCompromisedAction) (InsertedID interface{})
- func InsertReportUnsafeAction(Publickey, MongoEnv, dbname, colname string, r *http.Request) string
- func InsertUserdata(MongoConn *mongo.Database, ...) (InsertedID interface{})
- func IsAdmin(Tokenstr, PublicKey string) bool
- func IsUser(TokenStr, Publickey string) bool
- func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func PasswordValidator(MongoConn *mongo.Database, colname string, userdata User) bool
- func Register(Mongoenv, dbname string, r *http.Request) string
- func S3Client(c Config) (*s3.Client, error)
- func SaveUploadedFile(file *multipart.FileHeader, bucketName string, s3Client *s3.Client) (string, error)
- func SetConnection(MongoString, dbname string) *mongo.Database
- func TokenEncoder(username, privatekey string) string
- func UpdateReportAction(Mongoconn *mongo.Database, ctx context.Context, rpt ReportUnsafeAction) (UpdateId interface{}, err error)
- func UpdateReportCompromised(Mongoconn *mongo.Database, ctx context.Context, colname string, ...) (UpdateId interface{}, err error)
- func UpdateReportUnsafeAction(Publickey, MongoEnv, dbname, colname string, r *http.Request) string
- func UpdateUser(mongoconn *mongo.Database, user User) (Updatedid interface{})
- func UpdateUserAdmin(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string
- func UploadFileHandler(w http.ResponseWriter, r *http.Request)
- type Area
- type Config
- type Cred
- type Credential
- type Location
- type Payload
- type ReportCompromisedAction
- func GetAllCompromisedActionData(Mongoconn *mongo.Database, colname string) []ReportCompromisedAction
- func GetAllCompromisedActionDataByUser(conn *mongo.Database, colname, nipp string) ([]ReportCompromisedAction, error)
- func GetOneCompromisedActionData(mongoconn *mongo.Database, colname, Reportid string) (dest ReportCompromisedAction)
- func GetReportCompromisedByID(MongoConn *mongo.Database, reportID string) *ReportCompromisedAction
- type ReportUnsafeAction
- type ReqUsers
- type RequestReport
- type RequestReportCompromisedAction
- type Response
- type ResponseBack
- type ResponseDataUser
- type ResponseEncode
- type ResponseReport
- type ResponseReportBanyak
- type ResponseReportCompromisedAction
- type ResponseReportCompromisedActionBanyak
- type TypeDangerousActions
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func CompareNipp ¶ added in v0.0.51
func DecodeGetRole ¶ added in v0.0.51
func DecodeGetRoleandUser ¶ added in v0.0.51
func DecodeGetUser ¶ added in v0.0.51
func DeleteCompromisedAction ¶ added in v1.2.5
func DeleteCompromisedActionData ¶ added in v1.2.5
func DeleteDataReport ¶ added in v1.2.3
func DeleteDataUser ¶ added in v1.2.31
func DeleteReportData ¶ added in v0.0.56
func DeleteUser ¶ added in v0.0.38
func EncodeWithRole ¶ added in v0.0.51
func FollowUpCompromisedAction ¶ added in v1.2.5
func GCFReturnStruct ¶
func GetAllCompromisedActions ¶ added in v1.2.5
func GetAllCompromisedActionsByUser ¶ added in v1.2.5
func GetAllReport ¶ added in v0.0.56
func GetAllReportByNipp ¶ added in v1.1.18
func GetAllUserData ¶ added in v1.2.3
func GetDataUser ¶ added in v1.1.6
func GetOneCompromisedAction ¶ added in v1.2.5
CRUD Compromised Action
func GetOneReport ¶ added in v0.0.56
CRUD Unsafe Action
func HashPassword ¶
func InsertCompromisedAction ¶ added in v1.2.5
func InsertOneDoc ¶ added in v0.0.51
func InsertReportAction ¶ added in v1.2.5
func InsertReportAction(MongoConn *mongo.Database, colname string, rpt ReportUnsafeAction) (InsertedID interface{})
func InsertReportCompromised ¶ added in v1.2.5
func InsertReportCompromised(MongoConn *mongo.Database, colname string, rpt ReportCompromisedAction) (InsertedID interface{})
func InsertReportUnsafeAction ¶ added in v1.2.5
func InsertUserdata ¶ added in v0.0.51
func PasswordValidator ¶ added in v0.0.51
func S3Client ¶ added in v1.1.43
S3Client mengembalikan klien S3 baru untuk konfigurasi R2 yang diberikan.
func SaveUploadedFile ¶ added in v1.1.36
func SaveUploadedFile(file *multipart.FileHeader, bucketName string, s3Client *s3.Client) (string, error)
SaveUploadedFile menyimpan file ke R2 menggunakan metode tertentu
func SetConnection ¶
func TokenEncoder ¶ added in v0.0.51
func UpdateReportAction ¶ added in v1.2.5
func UpdateReportCompromised ¶ added in v1.2.5
func UpdateReportUnsafeAction ¶ added in v1.2.5
func UpdateUser ¶ added in v1.2.16
func UpdateUserAdmin ¶ added in v1.2.23
func UploadFileHandler ¶ added in v1.1.36
func UploadFileHandler(w http.ResponseWriter, r *http.Request)
UploadFileHandler menangani permintaan pengunggahan file
Types ¶
type Area ¶ added in v0.0.53
type Credential ¶
type Location ¶ added in v0.0.58
type Payload ¶ added in v0.0.38
type ReportCompromisedAction ¶ added in v1.2.5
type ReportCompromisedAction struct { Reportid string `json:"reportid"` Date string `json:"date"` Time string `json:"time" bson:"time"` User User `json:"user"` Location Location `json:"location"` Area Area `json:"area"` Description string `json:"description"` ObservationPhoto string `json:"observationPhoto"` TypeDangerousActions []TypeDangerousActions `json:"typeDangerousActions" bson:"typeDangerousActions,omitempty"` ImmediateAction string `json:"immediateAction" bson:"immediateAction"` ImprovementPhoto string `json:"improvementPhoto" bson:"improvementPhoto"` Recomendation string `json:"recomendation"` ActionDesc string `json:"ActionDesc"` EvidencePhoto string `json:"EvidencePhoto"` Status string `json:"status"` }
func GetAllCompromisedActionData ¶ added in v1.2.5
func GetAllCompromisedActionData(Mongoconn *mongo.Database, colname string) []ReportCompromisedAction
func GetAllCompromisedActionDataByUser ¶ added in v1.2.5
func GetAllCompromisedActionDataByUser(conn *mongo.Database, colname, nipp string) ([]ReportCompromisedAction, error)
func GetOneCompromisedActionData ¶ added in v1.2.5
func GetOneCompromisedActionData(mongoconn *mongo.Database, colname, Reportid string) (dest ReportCompromisedAction)
CRUD Compromised Action
func GetReportCompromisedByID ¶ added in v1.2.5
func GetReportCompromisedByID(MongoConn *mongo.Database, reportID string) *ReportCompromisedAction
type ReportUnsafeAction ¶ added in v1.2.5
type ReportUnsafeAction struct { Reportid string `json:"reportid" bson:"reportid"` Date string `json:"date" bson:"date"` Time string `json:"time" bson:"time"` User User `json:"user" bson:"user,omitempty"` Location Location `json:"location" bson:"location"` Description string `json:"description" bson:"description"` ObservationPhoto string `json:"observationPhoto" bson:"observationPhoto"` TypeDangerousActions []TypeDangerousActions `json:"typeDangerousActions" bson:"typeDangerousActions,omitempty"` Area Area `json:"area" bson:"area"` ImmediateAction string `json:"immediateAction" bson:"immediateAction"` ImprovementPhoto string `json:"improvementPhoto" bson:"improvementPhoto"` }
func GetAllReportData ¶ added in v0.0.56
func GetAllReportData(Mongoconn *mongo.Database, colname string) []ReportUnsafeAction
func GetAllReportDataByUser ¶ added in v1.1.13
func GetAllReportDataByUser(conn *mongo.Database, colname, nipp string) ([]ReportUnsafeAction, error)
func GetOneReportData ¶ added in v0.0.56
func GetOneReportData(mongoconn *mongo.Database, colname, Reportid string) (dest ReportUnsafeAction)
type RequestReport ¶ added in v0.0.53
type RequestReport struct {
Reportid string `json:"reportid"`
}
type RequestReportCompromisedAction ¶ added in v1.2.5
type RequestReportCompromisedAction struct {
Reportid string `json:"reportid"`
}
type Response ¶ added in v0.0.38
type Response struct {
Token string `json:"token,omitempty" bson:"token,omitempty"`
}
type ResponseBack ¶ added in v0.0.53
type ResponseDataUser ¶ added in v0.0.51
type ResponseEncode ¶ added in v0.0.51
type ResponseReport ¶ added in v0.0.53
type ResponseReport struct { Status int `json:"status"` Message string `json:"message"` Data ReportUnsafeAction `json:"data"` }
type ResponseReportBanyak ¶ added in v0.0.53
type ResponseReportBanyak struct { Status int `json:"status"` Message string `json:"message"` Data []ReportUnsafeAction `json:"data"` }
type ResponseReportCompromisedAction ¶ added in v1.2.5
type ResponseReportCompromisedAction struct { Status int `json:"status"` Message string `json:"message"` Data ReportCompromisedAction `json:"data"` }
type ResponseReportCompromisedActionBanyak ¶ added in v1.2.5
type ResponseReportCompromisedActionBanyak struct { Status int `json:"status"` Message string `json:"message"` Data []ReportCompromisedAction `json:"data"` }
type TypeDangerousActions ¶ added in v0.0.53
type User ¶
type User struct { Nipp string `json:"nipp" bson:"nipp"` Nama string `json:"nama" bson:"nama"` Jabatan string `json:"jabatan" bson:"jabatan"` Location Location `json:"location"` Password string `json:"password" bson:"password"` Role string `json:"role,omitempty" bson:"role,omitempty"` Timestamp time.Time `json:"timestamp" bson:"timestamp"` }
func GetAllUser ¶ added in v0.0.51
CRUD User
func GetOneUser ¶ added in v0.0.51
Click to show internal directories.
Click to hide internal directories.