http

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnswerGpsHandlerBuilder

func AnswerGpsHandlerBuilder(s storage.Storage) func(c echo.Context) error

func AnswerHandlerBuilder

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

func DownloadHandlerBuilder added in v0.0.5

func DownloadHandlerBuilder(s storage.Storage) func(e echo.Context) error

func IslandsHandler added in v0.0.11

func IslandsHandler(s storage.Storage) func(c echo.Context) error

func LineWebhookHandlerBuilder

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

func NoCacheMW added in v0.0.3

func NoCacheMW(next echo.HandlerFunc) echo.HandlerFunc

cache-busting middleware

func PriceHandler added in v0.0.11

func PriceHandler(s storage.Storage) func(c echo.Context) error

func SendLineMsgHandlerBuilder

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

func WipeUserHandlerBuilder

func WipeUserHandlerBuilder(s storage.Storage, 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.Storage
	LineBot *linebot.Client
	Surv    *survey.Survey
	Conf    *ApiConf
}

func NewApi

func NewApi(s storage.Storage, 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 MsgVars

type MsgVars struct {
	UserId string
}

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