domain

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: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAnswersEmpty = errors.New("Cannot do this operation on an empty Answers struct")
View Source
var ErrAnswersIdExists = errors.New("Duplicate question id")
View Source
var ErrAnswersIndexOutOfRange = errors.New("Index out of range")
View Source
var ErrAnswersNoNext = errors.New("No next question")
View Source
var ErrQuestionsEmpty = errors.New("Cannot do this operation on an empty Questions struct")
View Source
var ErrQuestionsIdExists = errors.New("Duplicate question id")
View Source
var ErrQuestionsIndexOutOfRange = errors.New("Index out of range")
View Source
var ErrQuestionsNoNext = errors.New("No next question")

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Id         uint
	UserId     string
	QuestionId string
	Answer     string
	Channel    string
	Timestamp  time.Time
}

type AnswerGps

type AnswerGps struct {
	Id        uint
	UserId    string
	Lat       float64
	Lon       float64
	Address   string
	Channel   string
	Timestamp time.Time
}

type Answers

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

stores a list of Question objects not a map because we need to keep the order of the Answers maps in Go do not keep order

func NewAnswers

func NewAnswers() *Answers

func (*Answers) Add

func (qs *Answers) Add(id, question string, weight int) error

func (*Answers) At

func (qs *Answers) At(index int) (q *Question, err error)

func (*Answers) Last

func (qs *Answers) Last() (q *Question, err error)

func (*Answers) MarshalJSON

func (qs *Answers) MarshalJSON() ([]byte, error)

func (*Answers) Next

func (qs *Answers) Next(qid string) (q *Question, err error)

type GlobalTplVars

type GlobalTplVars struct {
	Hostname string
}

type LineEventExport added in v0.0.20

type LineEventExport struct {
	EventType   string
	UserId      string
	DisplayName string
	EventTime   string
}

LineEventExport: used for CSV events download

type Location added in v0.0.11

type Location struct {
	Id        uint64  `json:"id"`
	Name      string  `json:"name"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type LocationPrice added in v0.0.11

type LocationPrice struct {
	Location
	Price float64 `json:"price"`
}

type LocationThai added in v0.0.11

type LocationThai struct {
	Location
	NameThai string `json:"name_thai"`
}

type Question

type Question struct {
	Id      string
	Text    string
	Weight  int
	Channel string
}

type Questions

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

stores a list of Question objects not a map because we need to keep the order of the questions maps in Go do not keep order

func NewQuestions

func NewQuestions() *Questions

func (*Questions) Add

func (qs *Questions) Add(id, question string, weight int, channel string) error

func (*Questions) At

func (qs *Questions) At(index int) (q *Question, err error)

func (*Questions) Last

func (qs *Questions) Last() (q *Question, err error)

func (*Questions) Len added in v0.0.5

func (qs *Questions) Len() int

func (*Questions) MarshalJSON

func (qs *Questions) MarshalJSON() ([]byte, error)

func (*Questions) Next

func (qs *Questions) Next(qid string) (q *Question, err error)

type UserProfile

type UserProfile struct {
	UserId        string
	DisplayName   string
	Timestamp     int
	SurveyStarted bool
	// if false: user blocked the bot
	Active bool
}

Jump to

Keyboard shortcuts

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