polling

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 12 Imported by: 0

README

polling

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTimestampToJkt added in v0.0.2

func ConvertTimestampToJkt(waktu time.Time) time.Time

func HandleUserInput added in v0.0.3

func HandleUserInput(Pesan model.IteungMessage, mongoconn *mongo.Database, selectedCandidate int) (reply string)

func Handler

func Handler(Pesan model.IteungMessage, mongoconn *mongo.Database) (reply string)

func InsertPolling added in v0.0.2

func InsertPolling(Pesan model.IteungMessage, Keterangan string, NomorKandidat string, mongoconn *mongo.Database) (InsertedID interface{})

func ListKandidatMessage added in v0.0.3

func ListKandidatMessage(mongoconn *mongo.Database) string

func MessagePolling added in v0.0.2

func MessagePolling(anggota Anggota, kandidat Kandidat, id interface{}) string

func MessageSudahPolling added in v0.0.2

func MessageSudahPolling(anggota Anggota, kandidat Kandidat) string

func MintaQRCode added in v0.0.6

func MintaQRCode() string

func PilihKandidat added in v0.0.6

func PilihKandidat(Teks string, Pesan model.IteungMessage, mongoconn *mongo.Database) (reply string)

func PollingHandler added in v0.0.2

func PollingHandler(Pesan model.IteungMessage, mongoconn *mongo.Database, selectedCandidate int) string

Types

type Anggota added in v0.0.2

type Anggota struct {
	Id          primitive.ObjectID `bson:"_id" json:"id"`
	NamaAnggota string             `bson:"nama_anggota" json:"nama_anggota"`
	PhoneNumber string             `bson:"phone_number" json:"phone_number"`
}

func GetAnggota added in v0.0.2

func GetAnggota(db *mongo.Database) (data []Anggota, err error)

func GetAnggotaFromPhoneNumber added in v0.0.2

func GetAnggotaFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (anggota Anggota)

type Kandidat added in v0.0.2

type Kandidat struct {
	Id            primitive.ObjectID `bson:"_id" json:"_id"`
	NamaKandidat  string             `bson:"nama_kandidat" json:"nama_kandidat"`
	NomorKandidat string             `bson:"nomor_kandidat" json:"nomor_kandidat"`
	PhoneNumber   string             `bson:"phone_number" json:"phone_number"`
}

func GetKandidat added in v0.0.2

func GetKandidat(db *mongo.Database) (data []Kandidat, err error)

func GetKandidatByIndex added in v0.0.3

func GetKandidatByIndex(mongoconn *mongo.Database, index int) (kandidat Kandidat)

func GetKandidatByNomorUrut added in v0.0.3

func GetKandidatByNomorUrut(mongoconn *mongo.Database, NomorKandidat string) (selectedKandidat Kandidat)

func GetKandidatFromPhoneNumber added in v0.0.2

func GetKandidatFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (kandidat Kandidat)

func GetOneKandidat added in v0.1.0

func GetOneKandidat(NomorKandidat, db *mongo.Database) (data Kandidat)

type KandidatInfo added in v0.0.2

type KandidatInfo struct {
	NamaKandidat  string `bson:"nama_kandidat" json:"nama_kandidat"`
	NomorKandidat string `bson:"nomor_kandidat" json:"nomor_kandidat"`
}

func GetNamaAndNomorKandidat added in v0.0.2

func GetNamaAndNomorKandidat(db *mongo.Database) (data []KandidatInfo, err error)

type Polling added in v0.0.2

type Polling struct {
	Id          primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Datetime    time.Time          `bson:"datetime" json:"datetime"`
	PhoneNumber string             `bson:"phone_number" json:"phone_number"`
	Keterangan  string             `bson:"keterangan" json:"keterangan"`
	Kandidat    Kandidat           `bson:"kandidat" json:"kandidat"`
	Anggota     Anggota            `bson:"anggota" json:"anggota"`
}

func GetPollingFromPhoneNumber added in v0.0.2

func GetPollingFromPhoneNumber(mongoconn *mongo.Database, phone_number string) (polling Polling)

Jump to

Keyboard shortcuts

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