package
0.1.0
Repository: https://github.com/kampsy/abot.git
Documentation: pkg.go.dev

# Functions

GetAddress searches the database for a specific address by its ID.
GetMsg returns a message for a given message ID.
GetUser from an HTTP request.
NewAdmin returns a singleton that represents the current admin running the deployed service.
NewAtomicSet returns an AtomicSet to track whether string values have been set or not in an efficient and thread-safe way.
NewHandlerMap builds a HandlerMap from a slice of RouteHandlers.
NewPurchase creates a Purchase and fills in information like a pricing breakdown automatically based on a provided PurchaseConfig.
NewStateMachine initializes a stateMachine to its starting state.
NewVocab returns Vocab with all Commands and Objects stemmed using the Porter2 Snowball algorithm.

# Variables

ErrInvalidFlexIDType is returned when a FlexIDType is invalid not matching one of the pre-defined FlexIDTypes for email (1) or phone (2).
ErrMissingFlexID is returned when a FlexID is expected, but none found.
ErrMissingFlexIDType is returned when a FlexIDType is expected, but none found.
ErrMissingUser is returned when a user expected, but none found.
ErrNoAddress signals that no address could be found when one was expected.

# Structs

Address holds all relevant information in an address for presentation to the user and communication to external services, including the USPS address validation tool.
Admin is a special type of user that has access to Abot's admin panel.
AtomicSet is a thread-safe map that acts as a Set of strings (no duplicates are possible).
Card represents a credit card.
CardParams is used when saving a new card.
City represents a city within a specific country.
HTTPRoute defines a route to be used within a HandlerMap.
Location represents some location saved for a user or plugin.
Memory holds a generic "memory" of Ava's usually set by a plugin, such as the current state of a plugin, selected products, results of a search, current offset in those search results, etc.
Msg is a message received by a user.
Phone represents a phone as a flexid from the database.
Product represents a product result returned from ElasticSearch.
ProductSel is a user's product selection, keeping track of both the product selected and the quantity desired.
Purchase represents a user purchase and associated useful information such as a breakdown of pricing, products purchased and the time a delivery is expected.
PurchaseConfig is a smaller set of purchase information that plugins can use to more easily build a full Purchase.
RouteHandler is a complete struct containing both an HTTPRoute and a handler.
State is a collection of pre-defined functions that are run when a user reaches the appropriate state within a stateMachine.
StateMachine enables plugin developers to easily build complex state machines given the constraints and use-cases of an A.I.
TimeRange defines a range of time.
User represents a user, which is usually the user that sent a message to Abot.
Vendor represents some seller of a product or service Ava provides that is contactable via email to notify them of a new user purchase or transaction.
Vocab maintains sets of Commands and Objects recognized by plugins as well as the functions to be performed when such Commands or Objects are found.
VocabHandler maintains sets of Commands and Objects recognized by plugins as well as the functions to be performed when such Commands or Objects are found.

# Interfaces

Contactable defines an interface used by dt.MailClient to send customized emails to users, vendors and admins.

# Type aliases

AuthMethod allows you as the plugin developer to control the level of security required in an authentication.
EventRequest is sent to the state machine to request safely jumping between states (directly to a specific Label) with guards checking that each new state is valid.
FlexIDType is used to identify a user when only an email, phone, or other "flexible" ID is available.
HandlerMap maps HTTPRoutes (the method and URL path) to a echo router handler.
ProductSels represents a slice of product selections, adding a helper method that makes it easy to calculate the prices (subtotal, tax, shipping, and total).
VocabFn is a function run when the user sends a matched vocab word as defined by a plugin.