models

package
v0.0.0-...-a89edb0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericMessage

type GenericMessage struct {
	Attachment MessageAttachment `json:"attachment"`
}

type MessageAttachment

type MessageAttachment struct {
	Type    string         `json:"type"`
	Payload MessagePayload `json:"payload"`
}

type MessageEntry

type MessageEntry struct {
	Messaging []MessageEvent `json:"messaging"`
}

type MessageEvent

type MessageEvent struct {
	Sender    User        `json:"sender"`
	Timestamp int64       `json:"timestamp"`
	Message   TextMessage `json:"message"`
}

type MessagePayload

type MessagePayload struct {
	TemplateType string                  `json:"template_type"`
	Elements     []MessagePayloadElement `json:"elements"`
}

type MessagePayloadElement

type MessagePayloadElement struct {
	Title    string                        `json:"title"`
	Subtitle string                        `json:"subtitle"`
	Buttons  []MessagePayloadElementButton `json:"buttons"`
}

type MessagePayloadElementButton

type MessagePayloadElementButton struct {
	Type    string `json:"type"`
	Title   string `json:"title"`
	Payload string `json:"payload"`
}

type MessageRequestBody

type MessageRequestBody struct {
	Object string         `json:"object"`
	Entry  []MessageEntry `json:"entry"`
}

type MongoUserScore

type MongoUserScore struct {
	Id    string `bson:"_id"`
	Score int32  `bson:"score"`
}

type OutgoingGenericMessage

type OutgoingGenericMessage struct {
	Recipient User           `json:"recipient"`
	Message   GenericMessage `json:"message"`
}

type OutgoingMessage

type OutgoingMessage interface {
}

type OutgoingTextMessage

type OutgoingTextMessage struct {
	Recipient User        `json:"recipient"`
	Message   TextMessage `json:"message"`
}

type PostbackEntry

type PostbackEntry struct {
	Messaging []PostbackEvent `json:"messaging"`
}

type PostbackEvent

type PostbackEvent struct {
	Sender    User            `json:"sender"`
	Timestamp int64           `json:"timestamp"`
	Postback  PostbackPayload `json:"postback"`
}

type PostbackPayload

type PostbackPayload struct {
	Payload string `json:"payload"`
}

type PostbackRequestBody

type PostbackRequestBody struct {
	Object string          `json:"object"`
	Entry  []PostbackEntry `json:"entry"`
}

type Question

type Question struct {
	Category         string   `json:"category"`
	Type             string   `json:"type"`
	Difficulty       string   `json:"difficulty"`
	Question         string   `json:"question"`
	CorrectAnswer    string   `json:"correct_answer"`
	IncorrectAnswers []string `json:"incorrect_answers"`
}

func (Question) ToTextMessage

func (question Question) ToTextMessage() (TextMessage, byte, byte, string)

type QuestionAPIResponseBody

type QuestionAPIResponseBody struct {
	ResponseCode int        `json:"response_code"`
	Results      []Question `json:"results"`
}

type RedisUserData

type RedisUserData struct {
	State             UserState
	CorrectAnswerText string
	CorrectAnswerChar byte
	MaxAcceptableChar byte
}

type TextMessage

type TextMessage struct {
	Text string `json:"text"`
}

type User

type User struct {
	Id string `json:"id"`
}

type UserState

type UserState int
const (
	USER_STATE_ACTIVE_QUESTION UserState = iota
	USER_STATE_WANT_QUESTION
	USER_STATE_IDLE
)

Jump to

Keyboard shortcuts

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