Versions in this module Expand all Collapse all v0 v0.1.0 Mar 15, 2016 Changes in this version + var ErrInvalidFlexIDType = errors.New("invalid flexid type") + var ErrMissingFlexID = errors.New("missing flexid") + var ErrMissingFlexIDType = errors.New("missing flexidtype") + var ErrMissingUser = errors.New("missing user") + var ErrNoAddress = errors.New("no address") + func GetAddress(dest *Address, db *sqlx.DB, id uint64) error + type Address struct + City string + Country string + DisplayAddress string + ID uint64 + Line1 string + Line2 string + Name string + State string + Zip string + Zip4 string + Zip5 string + type Admin struct + func NewAdmin() *Admin + func (a *Admin) GetEmail() string + func (a *Admin) GetName() string + type AtomicSet struct + func NewAtomicSet() AtomicSet + func (as AtomicSet) Get(k string) (exists bool) + func (as AtomicSet) Set(k string) + type AuthMethod int + type Card struct + AddressID sql.NullInt64 + Brand string + CardholderName string + ExpMonth int + ExpYear int + ID int + Last4 string + ServiceToken string + Zip5Hash []byte + type CardParams struct + AddressZip string + Brand string + CardholderName string + ExpMonth int + ExpYear int + Last4 string + ServiceToken string + type City struct + CountryCode string + Name string + type Contactable interface + GetEmail func() string + GetName func() string + type EventRequest int + type FlexIDType int + type HTTPRoute struct + Method string + Path string + type HandlerMap map[HTTPRoute]echo.Handler + func NewHandlerMap(rhs []RouteHandler) HandlerMap + func (hm HandlerMap) AddRoutes(prefix string, e *echo.Echo) + type Location struct + CreatedAt time.Time + Lat float64 + Lon float64 + Name string + func (l Location) IsRecent() bool + type Memory struct + Key string + Val []byte + func (m Memory) Bool() bool + func (m Memory) Int64() int64 + func (m Memory) String() string + type Msg struct + AbotSent bool + CreatedAt *time.Time + FlexID string + FlexIDType int + ID uint64 + NeedsTraining bool + Plugin string + Route string + Sentence string + State map[string]interface{} + Stems []string + StructuredInput *nlp.StructuredInput + Tokens []string + User *User + func GetMsg(db *sqlx.DB, id uint64) (*Msg, error) + func (m *Msg) GetLastRoute(db *sqlx.DB) (string, error) + func (m *Msg) Save(db *sqlx.DB) error + func (m *Msg) Update(db *sqlx.DB) error + type Phone struct + ID uint64 + Number string + type Product struct + Category string + ID string + Name string + Price uint64 + Reviews []struct{ ... } + Size string + Stock uint + Varietals []string + VendorID uint64 + type ProductSel struct + Count uint + type ProductSels []ProductSel + func (prods ProductSels) Prices(addr *Address) map[string]uint64 + type Purchase struct + AvaFee uint64 + CreatedAt *time.Time + CreditCardFee uint64 + DeliveryExpectedAt *time.Time + EmailsSentAt *time.Time + ID uint64 + ProductSels ProductSels + Products []string + Shipping uint64 + ShippingAddress *Address + ShippingAddressID sql.NullInt64 + Tax uint64 + Total uint64 + TransferFee uint64 + User *User + UserID uint64 + Vendor *Vendor + VendorID uint64 + VendorPaidAt *time.Time + VendorPayout uint64 + func NewPurchase(db *sqlx.DB, pc *PurchaseConfig) (*Purchase, error) + func (p *Purchase) Create() error + func (p *Purchase) DisplayID() string + func (p *Purchase) Subtotal() uint64 + func (p *Purchase) UpdateEmailsSent() error + type PurchaseConfig struct + Prices []uint64 + ProductSels ProductSels + ShippingAddress *Address + VendorID uint64 + type RouteHandler struct + Handler echo.Handler + Method string + Path string + type State struct + Complete func(*Msg) (bool, string) + Label string + OnEntry func(*Msg) string + OnInput func(*Msg) + SkipIfComplete bool + type StateMachine struct + Handlers []State + func NewStateMachine(pluginName string) *StateMachine + func (sm *StateMachine) GetDBConn() *sqlx.DB + func (sm *StateMachine) GetMemory(in *Msg, k string) Memory + func (sm *StateMachine) HasMemory(in *Msg, k string) bool + func (sm *StateMachine) LoadState(in *Msg) + func (sm *StateMachine) Next(in *Msg) (response string) + func (sm *StateMachine) OnInput(in *Msg) + func (sm *StateMachine) Reset(in *Msg) + func (sm *StateMachine) SetDBConn(s *sqlx.DB) + func (sm *StateMachine) SetLogger(l *log.Logger) + func (sm *StateMachine) SetMemory(in *Msg, k string, v interface{}) + func (sm *StateMachine) SetOnReset(reset func(in *Msg)) + func (sm *StateMachine) SetState(in *Msg, label string) string + func (sm *StateMachine) SetStates(sss ...[]State) + func (sm *StateMachine) State() int + type TimeRange struct + End *time.Time + Start *time.Time + type User struct + Admin bool + AuthorizationID sql.NullInt64 + Email string + ID uint64 + LastAuthenticated *time.Time + LastAuthenticationMethod AuthMethod + LocationID int + Name string + Password string + PaymentServiceID string + Trainer bool + func GetUser(db *sqlx.DB, c *echo.Context) (*User, error) + func (u *User) CheckActiveAuthorization(db *sqlx.DB) (bool, error) + func (u *User) Create(db *sqlx.DB, fidT FlexIDType, fid string) error + func (u *User) DeleteSessions(db *sqlx.DB) error + func (u *User) GetAddress(db *sqlx.DB, text string) (*Address, error) + func (u *User) GetCards(db *sqlx.DB) ([]Card, error) + func (u *User) GetEmail() string + func (u *User) GetName() string + func (u *User) GetPrimaryCard(db *sqlx.DB) (*Card, error) + func (u *User) IsAuthenticated(m AuthMethod) (bool, error) + func (u *User) SaveAddress(db *sqlx.DB, addr *Address) (uint64, error) + func (u *User) UpdateAddressName(db *sqlx.DB, id uint64, name string) (*Address, error) + type Vendor struct + BusinessName string + ContactEmail string + ContactName string + ID uint64 + func (v *Vendor) GetEmail() string + func (v *Vendor) GetName() string + type Vocab struct + Commands map[string]struct{} + Objects map[string]struct{} + func NewVocab(vhs ...VocabHandler) *Vocab + func (v *Vocab) HandleKeywords(m *Msg) string + type VocabFn func(m *Msg, mod int) (response string) + type VocabHandler struct + Fn VocabFn + Trigger *nlp.StructuredInput