Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Routes = struct { CreateUser, GetUser, GetAnimals, ListMoods, SetMood, GetMood, DeleteMood, ListConversations, CreateConversation, GetConversation, DeleteConversation, CreateLine, GetLine, DeleteLine *pat.Pattern }{ CreateUser: pat.Post("/users"), GetUser: pat.Get("/users/:id"), GetAnimals: pat.Get("/animals"), ListMoods: pat.Get("/moods"), SetMood: pat.Put("/moods/:mood"), GetMood: pat.Get("/moods/:mood"), DeleteMood: pat.Delete("/moods/:mood"), ListConversations: pat.Get("/conversations"), CreateConversation: pat.Post("/conversations"), GetConversation: pat.Get("/conversations/:conversation"), DeleteConversation: pat.Delete("/conversations/:conversation"), CreateLine: pat.Post("/conversations/:conversation/lines"), GetLine: pat.Get("/conversations/:conversation/lines/:line"), DeleteLine: pat.Delete("/conversations/:conversation/lines/:line"), }
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App encapsulates the handlers for the saypi API
func New ¶
func New(config *Configuration) (*App, error)
New creates an App for the given configuration.
type Configuration ¶
type Configuration struct { DBDSN string // postgres data source name DBMaxIdle int // maximum number of idle DB connections DBMaxOpen int // maximum number of open DB connections IPPerMinute int // maximum number of requests per IP per minute IPRateBurst int // maximum burst of requests from an IP UserSecret []byte // secret for generating secure user tokens }
Configuration represents the configuration for an App
Click to show internal directories.
Click to hide internal directories.