pollbot

package
v0.0.0-...-3abce5f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*base.DB
}

func NewDB

func NewDB(db *sql.DB) *DB

func (*DB) CastVote

func (d *DB) CastVote(username string, vote Vote) error

func (*DB) CreatePoll

func (d *DB) CreatePoll(id string, convID chat1.ConvIDStr, msgID chat1.MessageID, resultMsgID chat1.MessageID, numChoices int) error

func (*DB) GetPollInfo

func (d *DB) GetPollInfo(id string) (convID chat1.ConvIDStr, resultMsgID chat1.MessageID, numChoices int, err error)

func (*DB) GetTally

func (d *DB) GetTally(id string) (res Tally, err error)

type HTTPSrv

type HTTPSrv struct {
	*base.HTTPSrv
	// contains filtered or unexported fields
}

func NewHTTPSrv

func NewHTTPSrv(stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig,
	db *DB, tokenSecret string) *HTTPSrv

func (*HTTPSrv) LoginToken

func (h *HTTPSrv) LoginToken(username string) string

type Handler

type Handler struct {
	*base.DebugOutput
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig,
	httpSrv *HTTPSrv, db *DB, httpPrefix string) *Handler

func (*Handler) HandleCommand

func (h *Handler) HandleCommand(msg chat1.MsgSummary) error

func (*Handler) HandleNewConv

func (h *Handler) HandleNewConv(conv chat1.ConvSummary) error

type Tally

type Tally []TallyResult

type TallyResult

type TallyResult struct {
	// contains filtered or unexported fields
}

type Vote

type Vote struct {
	ID     string
	Choice int
}

func NewVote

func NewVote(id string, choice int) Vote

func NewVoteFromEncoded

func NewVoteFromEncoded(sdat string) Vote

func (Vote) Encode

func (v Vote) Encode() string

Jump to

Keyboard shortcuts

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