projeku

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 11 Imported by: 0

README

Update Library GISWisataBandung

go get -u all
go mod tidy
git tag                                 #cek riwayat versi tag
git tag v1.0.0                          #set versi tag
git push origin v1.0.0     #push tag version ke repo
go list -m github.com/AkbarHasballah/projeku@v1.0.0   #publish ke PKG go Dev

go get github.com/AkbarHasballah/projeku #Jika ingin Menggunakan Package atau library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

func IsPasswordValid

func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database

func SigninHandler

func SigninHandler(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func Signup

func Signup(w http.ResponseWriter, r *http.Request)

Types

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"`
}

type SignupPayload

type SignupPayload struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type User

type User struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL