server

package
v0.0.0-...-6fa73da Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeZone = "America/Los_Angeles"

Functions

func Dump

func Dump(obj interface{}) []byte

Types

type GetHealthResponse

type GetHealthResponse struct {
	OK bool `json:"ok"`
}

type IncomingMessageRequest

type IncomingMessageRequest struct {
	AccountSID string `json:"account_sid"`
	From       string `json:"from"`
	Body       string `json:"body"`
}

type PostSubscribeRequest

type PostSubscribeRequest struct {
	// The phone number to establish a subscription to.
	Number string `json:"number"`

	// The time zone that the user selected.
	Timezone string `json:"timezone"`
}

type PostSubscribeResponse

type PostSubscribeResponse struct {
	Number string `json:"number,omitempty"`

	Timezone string `json:"timezone,omitempty"`

	Error string `json:"error,omitempty"`

	Subscribed bool `json:"subscribed"`
}

type Server

type Server struct {
	DefaultTimeZone string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(managers managers.Managers, sender *twilio.Sender, development bool, assetBasedir string) *Server

func (*Server) GetHealth

func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

func (*Server) PostIncomingMessage

func (s *Server) PostIncomingMessage(w http.ResponseWriter, r *http.Request)

func (*Server) PostSubscribe

func (s *Server) PostSubscribe(w http.ResponseWriter, r *http.Request)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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