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: 1

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 added in v0.0.11

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

func LineEventsDownloadHandlerBuilder added in v0.0.20

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

func LineImgHandler added in v0.0.14

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 added in v0.0.28

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

func NoCacheMW added in v0.0.3

func NoCacheMW(next echo.HandlerFunc) echo.HandlerFunc

cache-busting middleware

func SendLineCustomQuestionHandlerBuilder added in v0.0.20

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 added in v0.0.34

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

type MsgVars

type MsgVars struct {
	UserId string
}

type SendLineCustomQuestionRequest added in v0.0.20

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