survey

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Initiator

type Initiator struct {
	Bot        *linebot.Client
	Storage    *storage.Sql
	Survey     *Survey
	GlobalVars *domain.GlobalTplVars
}

func NewInitiator

func NewInitiator(surv *Survey, s *storage.Sql, bot *linebot.Client, globalVars *domain.GlobalTplVars) *Initiator

func (*Initiator) Monitor

func (i *Initiator) Monitor(delay int64, errc chan error)

type Normaliser added in v0.0.19

type Normaliser struct {
	Storage *storage.Sql
}

func NewNormaliser added in v0.0.19

func NewNormaliser(storage *storage.Sql) *Normaliser

func (*Normaliser) Start added in v0.0.19

func (n *Normaliser) Start(errc chan error)

type QuestionTemplateVars

type QuestionTemplateVars struct {
	UserId   string
	Hostname string
}

type Survey

type Survey struct {
	Storage   *storage.Sql
	Questions *domain.Questions
}

func NewSurvey

func NewSurvey(storage *storage.Sql, questions *domain.Questions) (survey *Survey)

func (*Survey) GetNextQuestion

func (s *Survey) GetNextQuestion(userId string, tplVars *QuestionTemplateVars) (question *domain.Question, err error)

func (*Survey) RecordAnswer

func (s *Survey) RecordAnswer(userId, answerText, channel string) (domain.Answer, error)

func (*Survey) RecordAnswerRaw added in v0.0.20

func (s *Survey) RecordAnswerRaw(userId, questionId, answerText, channel string) error

func (*Survey) RecordGpsAnswer

func (s *Survey) RecordGpsAnswer(userId string, lat, lon float64, address string, channel string) (err error)

Jump to

Keyboard shortcuts

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