backenduser

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 12 Imported by: 2

README

swaggerbe

backend untuk swagager

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DeleteDataTicket added in v0.0.2

func DeleteDataTicket(Mongoenv, dbname string, r *http.Request) string

delete

func DeleteDataTransaksi added in v0.0.3

func DeleteDataTransaksi(Mongoenv, dbname string, r *http.Request) string

func DeleteOneDoc

func DeleteOneDoc(db *mongo.Database, col string, filter bson.M) (err error)

func DeleteTicket added in v0.0.2

func DeleteTicket(db *mongo.Database, col string, _id primitive.ObjectID) (status bool, err error)

delete

func DeleteTransaksi added in v0.0.3

func DeleteTransaksi(db *mongo.Database, col string, _id primitive.ObjectID) (status bool, err error)

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GetAllData

func GetAllData(MONGOCONNSTRINGENV, dbname, collectionname string) string

get

func GetAllDocs

func GetAllDocs(db *mongo.Database, col string, docs interface{}) interface{}

func GetDataReview added in v0.0.4

func GetDataReview(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GetDataTransaksi

func GetDataTransaksi(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GetOneDataTicket added in v0.0.2

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

func GetOneDataTransaksi added in v0.0.3

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataPesan added in v0.0.4

func InsertDataPesan(Mongoenv, dbname string, r *http.Request) string

func InsertDataTicket added in v0.0.2

func InsertDataTicket(Mongoenv, dbname string, r *http.Request) string

insert

func InsertDataTransaksi

func InsertDataTransaksi(Mongoenv, dbname string, r *http.Request) string

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, col string, docs interface{}) (insertedID primitive.ObjectID, err error)

docs

func InsertPesanReview added in v0.0.4

func InsertPesanReview(db *mongo.Database, col string, pesandata Pesan) (insertedID primitive.ObjectID, err error)

func InsertTicket added in v0.0.2

func InsertTicket(db *mongo.Database, col string, ticketdata Ticket) (insertedID primitive.ObjectID, err error)

func InsertTransaksi

func InsertTransaksi(db *mongo.Database, col string, transaksidata Transaksi) (insertedID primitive.ObjectID, err error)

func InsertUser

func InsertUser(db *mongo.Database, collection string, userdata User) string

insert

func IsPasswordValid

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

func Login

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

func SetConnection

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

func UpdateDataTicket added in v0.0.2

func UpdateDataTicket(Mongoenv, dbname string, r *http.Request) string

update

func UpdateDataTransaksi added in v0.0.3

func UpdateDataTransaksi(Mongoenv, dbname string, r *http.Request) string

func UpdateOneDoc

func UpdateOneDoc(db *mongo.Database, col string, filter, update interface{}) (err error)

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"`
	Data          []Ticket    `bson:"data,omitempty" json:"data,omitempty"`
	DataTransaksi []Transaksi `bson:"datatransaksi,omitempty" json:"datatransaksi,omitempty"`
}

type Pesan added in v0.0.4

type Pesan struct {
	ID     primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Nama   string             `bson:"nama,omitempty" json:"nama,omitempty"`
	Subjek string             `bson:"subjek,omitempty" json:"subjek,omitempty"`
	Pesan  string             `bson:"pesan,omitempty" json:"pesan,omitempty"`
}

func GetAllDataReview added in v0.0.4

func GetAllDataReview(db *mongo.Database, col string) (pesanlist []Pesan)

type Ticket added in v0.0.2

type Ticket struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Nama      string             `bson:"nama,omitempty" json:"nama,omitempty"`
	Harga     string             `bson:"harga,omitempty" json:"harga,omitempty"`
	Deskripsi string             `bson:"deskripsi,omitempty" json:"deskripsi,omitempty"`
	Stok      string             `bson:"stok,omitempty" json:"stok,omitempty"`
}

func GetAllDataTicket added in v0.0.2

func GetAllDataTicket(db *mongo.Database, col string) (ticketlist []Ticket)

get

func GetTicketFromID added in v0.0.2

func GetTicketFromID(db *mongo.Database, col string, _id primitive.ObjectID) (*Ticket, error)

func UpdateTicket added in v0.0.2

func UpdateTicket(db *mongo.Database, col string, ticket Ticket) (tickets Ticket, status bool, err error)

update

type Transaksi

type Transaksi struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	NamaTicket  string             `bson:"namaticket,omitempty" json:"namaticket,omitempty"`
	Harga       string             `bson:"harga,omitempty" json:"harga,omitempty"`
	NamaPembeli string             `bson:"namapembeli,omitempty" json:"namapembeli,omitempty"`
	Email       string             `bson:"email,omitempty" json:"email,omitempty"`
	Alamat      string             `bson:"alamat,omitempty" json:"alamat,omitempty"`
	NoHP        string             `bson:"nohp,omitempty" json:"nohp,omitempty"`
	Quantity    string             `bson:"quantity,omitempty" json:"quantity,omitempty"`
	Total       string             `bson:"total,omitempty" json:"total,omitempty"`
}

func GetAllDataTransaksi

func GetAllDataTransaksi(db *mongo.Database, col string) (transaksilist []Transaksi)

func GetTransaksiFromID added in v0.0.3

func GetTransaksiFromID(db *mongo.Database, col string, _id primitive.ObjectID) (*Transaksi, error)

func UpdateTransaksi added in v0.0.3

func UpdateTransaksi(db *mongo.Database, col string, transaksi Transaksi) (transaksis Transaksi, status bool, err error)

type User

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

Jump to

Keyboard shortcuts

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