http

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: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnswerGpsHandlerBuilder

func AnswerGpsHandlerBuilder(s *storage.Sql) func(c echo.Context) error

func AnswerHandlerBuilder

func AnswerHandlerBuilder(s *storage.Sql, bot *linebot.Client) func(c echo.Context) error

func IslandsHandler

func IslandsHandler(s *storage.Sql) func(c echo.Context) error

func LineEventsDownloadHandlerBuilder

func LineEventsDownloadHandlerBuilder(s *storage.Sql) func(e echo.Context) error

func LineImgHandler

func LineImgHandler() func(c echo.Context) error

func LineWebhookHandlerBuilder

func LineWebhookHandlerBuilder(surv *survey.Survey, s *storage.Sql, bot *linebot.Client, globalVars *domain.GlobalTplVars) func(c echo.Context) error

func LocationPricesHandlerBuilder

func LocationPricesHandlerBuilder(s *storage.Sql) func(e echo.Context) error

func NoCacheMW

func NoCacheMW(next echo.HandlerFunc) echo.HandlerFunc

cache-busting middleware

func SendLineCustomQuestionHandlerBuilder

func SendLineCustomQuestionHandlerBuilder(s *storage.Sql, lineBot *linebot.Client) func(c echo.Context) error

func SendLineMsgHandlerBuilder

func SendLineMsgHandlerBuilder(s *storage.Sql, lineBot *linebot.Client) func(c echo.Context) error

func WipeUserHandlerBuilder

func WipeUserHandlerBuilder(s *storage.Sql, lineBot *linebot.Client) func(c echo.Context) error

Types

type AnswerGpsItem

type AnswerGpsItem struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type AnswerItem

type AnswerItem struct {
	QuestionId string `json:"question_id"`
	Answer     string `json:"answer"`
}

type AnswersGpsRequest

type AnswersGpsRequest struct {
	UserId   string        `json:"user_id"`
	Location AnswerGpsItem `json:"location"`
}

type AnswersRequest

type AnswersRequest struct {
	UserId  string       `json:"user_id"`
	Answers []AnswerItem `json:"answers"`
}

type Api

type Api struct {
	Storage *storage.Sql
	LineBot *linebot.Client
	Surv    *survey.Survey
	Conf    *ApiConf
}

func NewApi

func NewApi(s *storage.Sql, lb *linebot.Client, surv *survey.Survey, conf *ApiConf) *Api

func (*Api) Serve

func (a *Api) Serve() error

type ApiConf

type ApiConf struct {
	Port int
	// hostname where the API is hosted
	GlobalVars *domain.GlobalTplVars
}

type LoginPayload

type LoginPayload struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type MsgVars

type MsgVars struct {
	UserId string
}

type SendLineCustomQuestionRequest

type SendLineCustomQuestionRequest struct {
	QuestionId string `json:"question_id"`
	Text       string `json:"text"`
	ReplyText  string `json:"reply_text"`
}

type SendLineMsgRequest

type SendLineMsgRequest struct {
	UserIds  []string `json:"user_ids"`
	Messages []string `json:"messages"`
}

Jump to

Keyboard shortcuts

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