Documentation ¶
Index ¶
- Constants
- type Answer
- type AnswerContent
- type AnswerType
- type Assignment
- type Email
- type LinkedList
- type Meta
- type Node
- type Owner
- type Quest
- type QuestAvailable
- type QuestLine
- type QuestWithSteps
- type Question
- type QuestionType
- type Recipient
- type Rewards
- type SendQuestRequest
- type Status
- type Step
- type Theme
Constants ¶
View Source
const ( StatusNotStarted = "not_started" StatusInProgress = "in_progress" StatusFinished = "finished" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer struct { AnswerType AnswerType `json:"answer_type"` Answer string `json:"answer"` }
type AnswerContent ¶
type AnswerContent []string
func (*AnswerContent) Scan ¶
func (a *AnswerContent) Scan(value interface{}) error
Scan Make the Attrs struct implement the sql.Scanner interface. This method simply decodes a JSON-encoded Value into the struct fields.
type Assignment ¶
type LinkedList ¶
type LinkedList struct { Head *Node // contains filtered or unexported fields }
LinkedList represents a linked list
func (*LinkedList) Insert ¶
func (l *LinkedList) Insert(val Question)
Insert inserts new node at the end of from linked list
func (*LinkedList) MarshalJSON ¶
func (l *LinkedList) MarshalJSON() ([]byte, error)
type Node ¶
type Node struct { Value Question // contains filtered or unexported fields }
Node represents a node of linked list
type Quest ¶
type Quest struct { ID *string `json:"id" db:"id"` Name *string `json:"name" db:"name"` Description *string `json:"description" db:"description"` Owner *string `json:"owner" db:"owner"` Theme *Theme `json:"theme" db:"theme"` Recipients []Recipient `json:"recipients"` FinalMessage *string `json:"final_message" db:"final_message"` Rewards *Rewards `json:"rewards" db:"rewards"` CreatedAt *time.Time `json:"created_at" db:"created_at"` UpdatedAt *time.Time `json:"updated_at" db:"updated_at"` DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"` }
Quest represents a quest
type QuestAvailable ¶
type QuestAvailable struct { QuestId string `json:"quest_id" db:"quest_id"` QuestName string `json:"quest_name" db:"quest_name"` QuestDescription string `json:"quest_description" db:"quest_description"` QuestTheme string `json:"quest_theme" db:"quest_theme"` Status Status `json:"status" db:"status"` CurrentStep int `json:"steps_current" db:"steps_current"` StepsCount int `json:"steps_count" db:"steps_count"` Owner *Owner `json:"owner"` }
type QuestLine ¶
type QuestLine struct { QuestId string `json:"quest_id"` QuestName string `json:"quest_name"` QuestDescription string `json:"quest_description"` QuestTheme Theme `json:"quest_theme"` QuestStatus Status `json:"quest_status"` QuestionCount int `json:"question_count"` IsQuestionAnswerCorrect *bool `json:"success,omitempty"` List *LinkedList `json:"current"` PreviousQuestions []Question `json:"previous"` FinalMessage *string `json:"final_message,omitempty"` Rewards *Rewards `json:"rewards,omitempty"` }
func (*QuestLine) CheckIfAnswerCorrect ¶
func (*QuestLine) CurrentStep ¶
func (*QuestLine) IsLastStep ¶
type QuestWithSteps ¶
QuestWithSteps represents a quest
func (QuestWithSteps) NewQuestLine ¶
func (q QuestWithSteps) NewQuestLine(currentStep *int, status Status) *QuestLine
type Question ¶
type Question struct { ID *string `json:"id,omitempty"` QuestId *string `json:"quest_id"` Sort *int `json:"sort,omitempty" ` Description *string `json:"description,omitempty"` QuestionType *QuestionType `json:"question_type"` QuestionContent *string `json:"question_content"` AnswerType *AnswerType `json:"answer_type"` AnswerContent *AnswerContent `json:"-"` }
type QuestionType ¶
type QuestionType string
const ( QuestionText QuestionType = "text" QuestionQR QuestionType = "qr" QuestionSound QuestionType = "sound" QuestionImage QuestionType = "image" )
type SendQuestRequest ¶
type Step ¶
type Step struct { ID *string `json:"id,omitempty" db:"id"` QuestId *string `json:"quest_id" db:"quest_id"` Sort *int `json:"sort,omitempty" db:"sort"` Description *string `json:"description,omitempty" db:"description"` QuestionType *QuestionType `json:"question_type" db:"question_type"` QuestionContent *string `json:"question_content" db:"question_content"` AnswerType *AnswerType `json:"answer_type" db:"answer_type"` AnswerContent *AnswerContent `json:"answer_content" db:"answer_content"` CreatedAt *time.Time `json:"created_at" db:"created_at"` UpdatedAt *time.Time `json:"updated_at" db:"updated_at"` DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"` }
Click to show internal directories.
Click to hide internal directories.