database

package
v0.0.0-...-8c1ffaf Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitErr error
View Source
var InitMsg string

Functions

func Add

func Add(usr global.Stu) (string, error)

Add a user into the DB

func DelPwdResetDetails

func DelPwdResetDetails(rollno int) error

func DelRdmDetails

func DelRdmDetails(redeemer int) error

func DelTfrDetails

func DelTfrDetails(sender int) error

func GetBatchnRole

func GetBatchnRole(rollno int) (string, string, error)

Get the batch and role for the given rollno (if present)

func GetCntEvents

func GetCntEvents(rollno int) (int, error)

Get the count of the number of events in which the given rollno (if present) has participated in

func GetCoins

func GetCoins(rollno interface{}) (float64, error)

Get the balance for the given rollno (if present in the DB)

func GetJWTid

func GetJWTid(rollno int) (string, error)

func GetPwdResetDetails

func GetPwdResetDetails(rollno int) (global.PwdResetObj, string, error)

func GetRdmDetails

func GetRdmDetails(redeemer int) (global.RedeemObj, string, error)

func GetTfrDetails

func GetTfrDetails(sender int) (global.TxnObj, string, error)

func GetUsrDetails

func GetUsrDetails(rollno int) (struct{ Email, Pwd, Batch, Role string }, error)

Get the user details (password, batch, and role) for the given rollno (if present)

func RedeemReq

func RedeemReq(rdm global.RedeemObj) (interface{}, error)

Add an entry to the redeemRequests table in the DB

func Reward

func Reward(Tx global.TxnObj) (interface{}, error)

Lets an authorized Admin reward coins to a valid user

func SetJWTid

func SetJWTid(rollno int, jti string) error

func SetPwdResetDetails

func SetPwdResetDetails(resetPwd global.PwdResetObj) error

func SetRdmDetails

func SetRdmDetails(rdm global.RedeemObj) error

func SetTfrDetails

func SetTfrDetails(tfr global.TxnObj) error

func ShowAllRdmReqs

func ShowAllRdmReqs() (interface{}, error)

Show all pending redeem requests (to the admin) [A list of objects of type global.RedeemReqObj is returned]

func ShowRdmSts

func ShowRdmSts(redeemer int) (interface{}, error)

Show the statuses of all redeem requests to a user [A list of objects of type global.UserRedeemState is returned]

func Transact

func Transact(Tx global.TxnObj) (interface{}, error)

Lets an authorized, eligible user send coins to another valid, eligible user

func UpdPwd

func UpdPwd(rollno int, pwd string) error

func UpdRdmSts

func UpdRdmSts(redeemReq global.RedeemStatusUPDBody) (interface{}, error)

Update redeem status

Types

This section is empty.

Jump to

Keyboard shortcuts

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