utils

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPEMString added in v1.0.5

func CleanPEMString(pem string) string

func DeleteHistory

func DeleteHistory(mongoenv *mongo.Database, collname string, datahistory models.History) interface{}

func DeleteKantor

func DeleteKantor(mongoenv *mongo.Database, collname string, datakantor models.Kantor) interface{}

func DeletePelanggan

func DeletePelanggan(mongoenv *mongo.Database, collname string, datapelanggan models.Pelanggan) interface{}

func DeleteTransaksi

func DeleteTransaksi(mongoenv *mongo.Database, collname string, datatransaksi models.Transaksi) interface{}

func DeleteUser

func DeleteUser(mongoenv *mongo.Database, collname string, datauser models.Users) interface{}

func DummyHistoryGenerator

func DummyHistoryGenerator(n int, mconn *mongo.Database) (string, error)

func DummyKantorGenerator

func DummyKantorGenerator(mconn *mongo.Database) (string, error)

func DummyPelangganGenerator

func DummyPelangganGenerator(mconn *mongo.Database) (string, error)

func DummyTransaksiGenerator

func DummyTransaksiGenerator(n int, mconn *mongo.Database) (string, error)

func DummyUserGenerator

func DummyUserGenerator(n int, mconn *mongo.Database) (string, error)

func FindHistory

func FindHistory(mongoenv *mongo.Database, collname string, datahistory models.History) models.History

func FindKantor

func FindKantor(mongoenv *mongo.Database, collname string, datakantor models.Kantor) models.Kantor

func FindPelanggan

func FindPelanggan(mongoenv *mongo.Database, collname string, datapelanggan models.Pelanggan) models.Pelanggan

func FindTransaksi

func FindTransaksi(mongoenv *mongo.Database, collname string, datatransaksi models.Transaksi) models.Transaksi

func FindUser

func FindUser(mongoenv *mongo.Database, collname string, datauser models.Users) models.Users

func GenerateRSAPem added in v1.0.5

func GenerateRSAPem(privateFilename string, publicFilename string, bits int) error

func GenerateSecretKeyEnv added in v1.0.5

func GenerateSecretKeyEnv(privateKeyPath string) (string, string, error)

func GetAllHistory

func GetAllHistory(mongoenv *mongo.Database, collname string) ([]models.History, error)

func GetAllHistoryWithPagination

func GetAllHistoryWithPagination(mongoenv *mongo.Database, collname string, page, limit int) ([]models.History, models.DataCount, error)

func GetAllKantor

func GetAllKantor(mongoenv *mongo.Database, collname string) ([]models.Kantor, error)

func GetAllKantorWithPagination

func GetAllKantorWithPagination(mongoenv *mongo.Database, collname string, page, limit int) ([]models.Kantor, models.DataCount, error)

func GetAllPelanggan

func GetAllPelanggan(mongoenv *mongo.Database, collname string) ([]models.Pelanggan, error)

func GetAllPelangganByFilterWithPagination

func GetAllPelangganByFilterWithPagination(mongoenv *mongo.Database, collname string, page, limit int, tipe_pelanggan string) ([]models.Pelanggan, models.DataCount, error)

func GetAllPelangganWithPagination

func GetAllPelangganWithPagination(mongoenv *mongo.Database, collname string, page, limit int) ([]models.Pelanggan, models.DataCount, error)

func GetAllTransaksi

func GetAllTransaksi(mongoenv *mongo.Database, collname, no_pend, kode_pelanggan string, startDate, endDate time.Time) ([]models.Transaksi, error)

func GetAllTransaksiWithPagination

func GetAllTransaksiWithPagination(mongoenv *mongo.Database, collname, kode_pelanggan, no_pend string, page, limit int, startDate, endDate time.Time) ([]models.Transaksi, models.DataCount, error)

func GetAllUser

func GetAllUser(mongoenv *mongo.Database, collname string) ([]models.Users, error)

func GetAllUserWithPagination

func GetAllUserWithPagination(mongoenv *mongo.Database, collname string, page, limit int) ([]models.Users, models.DataCount, error)

func GetStatusDeliveredTransaksi added in v1.0.7

func GetStatusDeliveredTransaksi(mongoenv *mongo.Database, collname string, startDate, endDate time.Time) ([]models.Transaksi, error)

func GetUrlQuery added in v1.0.7

func GetUrlQuery(r *http.Request, queryKey string, defaultValue string) string

func HistoryExists

func HistoryExists(mongoenv *mongo.Database, collname string, datahistory models.History) bool

func InsertHistory

func InsertHistory(mongoenv *mongo.Database, collname string, datahistory models.History) (interface{}, error)

func InsertKantor

func InsertKantor(mongoenv *mongo.Database, collname string, datakantor models.Kantor) (interface{}, error)

func InsertPelanggan

func InsertPelanggan(mongoenv *mongo.Database, collname string, datapelanggan models.Pelanggan) (interface{}, error)

func InsertTransaksi

func InsertTransaksi(mongoenv *mongo.Database, collname string, datatransaksi models.Transaksi) (interface{}, error)

func InsertUser

func InsertUser(mongoenv *mongo.Database, collname string, datauser models.Users) (interface{}, error)

func IsPasswordValid

func IsPasswordValid(mongoenv *mongo.Database, collname string, datauser models.Users) bool

func KantorExists

func KantorExists(mongoenv *mongo.Database, collname string, datakantor models.Kantor) bool

func ParseBody added in v1.0.7

func ParseBody(w http.ResponseWriter, r *http.Request, v interface{})

func ParseDate added in v1.0.6

func ParseDate(dateStr string, isEndDate bool) (time.Time, error)

func PelangganExists

func PelangganExists(mongoenv *mongo.Database, collname string, datapelanggan models.Pelanggan) bool

func ReadPrivateKeyFromEnv added in v1.0.5

func ReadPrivateKeyFromEnv(private string) (*rsa.PrivateKey, error)

func ReadPrivateKeyFromFile

func ReadPrivateKeyFromFile(filename string) (*rsa.PrivateKey, error)

ReadPrivateKeyFromFile reads an RSA private key from a file

func ReadPublicKeyFromEnv added in v1.0.5

func ReadPublicKeyFromEnv(oublic string) (*rsa.PublicKey, error)

func ReadPublicKeyFromFile

func ReadPublicKeyFromFile(filename string) (*rsa.PublicKey, error)

func SetConnection

func SetConnection() *mongo.Database

func SignedJWT added in v1.0.7

func SignedJWT(mongoenv *mongo.Database, collname string, user models.Users) (string, error)

func TransaksiExists

func TransaksiExists(mongoenv *mongo.Database, collname string, datatransaksi models.Transaksi) bool

func UpdateHistory

func UpdateHistory(mongoenv *mongo.Database, collname string, datahistory models.History) interface{}

func UpdateKantor

func UpdateKantor(mongoenv *mongo.Database, collname string, datakantor models.Kantor) interface{}

func UpdatePelanggan

func UpdatePelanggan(mongoenv *mongo.Database, collname string, datapelanggan models.Pelanggan) interface{}

func UpdateTransaksi

func UpdateTransaksi(mongoenv *mongo.Database, collname string, datatransaksi models.Transaksi) interface{}

func UpdateUser

func UpdateUser(mongoenv *mongo.Database, collname string, datauser models.Users) interface{}

func UsernameExists

func UsernameExists(mongoenv *mongo.Database, collname string, datauser models.Users) bool

func WriteJSONResponse added in v1.0.7

func WriteJSONResponse(w http.ResponseWriter, status int, v interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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