Documentation ¶
Index ¶
- Variables
- func Close()
- func CountQuestions() int
- func FetchQuestion(question *Question) (str string)
- func FetchQuestionTime(quiz string) (res int64)
- func GetFromApi(req *http.Request, quiz string, options []string) (res map[string]int)
- func GetFromBaidu(quiz string, options []string) map[string]int
- func MergeQuestions(fs ...string)
- func Run(port string, mode, automatic int)
- func SetQuestion(question *Question)
- func ShowAllQuestions()
- func StoreQuestion(question *Question) error
- type ChooseResp
- type Question
- type QuestionCols
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Mode int AutoMatic int )
View Source
var (
QuestionBucket = "Question"
)
Functions ¶
func CountQuestions ¶
func CountQuestions() int
func FetchQuestion ¶
func FetchQuestionTime ¶
func GetFromApi ¶
func MergeQuestions ¶
func MergeQuestions(fs ...string)
func SetQuestion ¶
func SetQuestion(question *Question)
func ShowAllQuestions ¶
func ShowAllQuestions()
func StoreQuestion ¶
Types ¶
type ChooseResp ¶
type ChooseResp struct { Data struct { UID int `json:"uid"` Num int `json:"num"` Answer int `json:"answer"` Option int `json:"option"` Yes bool `json:"yes"` Score int `json:"score"` TotalScore int `json:"totalScore"` RowNum int `json:"rowNum"` RowMult int `json:"rowMult"` CostTime int `json:"costTime"` RoomID int `json:"roomId"` EnemyScore int `json:"enemyScore"` EnemyAnswer int `json:"enemyAnswer"` } `json:"data"` Errcode int `json:"errcode"` }
type Question ¶
type Question struct { Data struct { Quiz string `json:"quiz"` Options []string `json:"options"` Num int `json:"num"` School string `json:"school"` Type string `json:"type"` Contributor string `json:"contributor"` EndTime int `json:"endTime"` CurTime int `json:"curTime"` } `json:"data"` Errcode int `json:"errcode"` CalData struct { RoomID string Answer string TrueAnswer string // contains filtered or unexported fields } `json:"-"` }
func GetQuestion ¶
type QuestionCols ¶
func DecodeQuestionCols ¶
func DecodeQuestionCols(bs []byte, update int64) *QuestionCols
func NewQuestionCols ¶
func NewQuestionCols(answer string) *QuestionCols
func (*QuestionCols) GetData ¶
func (q *QuestionCols) GetData() []byte
Click to show internal directories.
Click to hide internal directories.