helper

package
v0.0.0-...-5480aad Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(passwordhash, hash string) bool

func DecodeGetUser

func DecodeGetUser(PublicKey, tokenStr string) (pay string, err error)

func Decoder

func Decoder(publickey, tokenstr string) (payload model.Payload, err error)

func EncodeWithUsername

func EncodeWithUsername(username, privatekey string) (string, error)

func FindAllUsers

func FindAllUsers(conn *mongo.Database) ([]model.User, error)

func FindUserByUsername

func FindUserByUsername(conn *mongo.Database, username string) (*model.User, error)

Get User

func GetAddress

func GetAddress() (ipport string, network string)

func HashPass

func HashPass(passwordhash string) (string, error)

Password

func InsertComment

func InsertComment(conn *mongo.Database, comment model.Comment) (InsertedID interface{})

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})

func InsertUserdata

func InsertUserdata(MongoConn *mongo.Database, username, email, password, passwordhash string) (InsertedID interface{})

func IsPasswordValid

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

func Jsonstr

func Jsonstr(strc interface{}) string

func QueriesALL

func QueriesALL(db *mongo.Database, ctx context.Context) (dest []model.Datasets, err error)

func QueriesDataRegexp

func QueriesDataRegexp(db *mongo.Database, ctx context.Context, queries string) (dest model.Datasets, err error)

func QueriesDataRegexpALL

func QueriesDataRegexpALL(db *mongo.Database, ctx context.Context, queries string) (dest model.Datasets, score float64, err error)

func QueriesSecret

func QueriesSecret(db *mongo.Database, ctx context.Context, secret string) (dest model.Secrets, err error)

func SeparateSuffixMu

func SeparateSuffixMu(word string) string

Fungsi untuk memisahkan kata dengan imbuhan "mu" di akhir

func SetConnection

func SetConnection() *mongo.Database

func Stemmer

func Stemmer(Sentences string) (newString string)

func WriteJSON

func WriteJSON(respw http.ResponseWriter, statusCode int, content interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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