Documentation ¶
Index ¶
- type ActionType
- type ConversationID
- type ConversationStatus
- type ConversationStatusType
- type Event
- func (e *Event) ConversationID() ConversationID
- func (e *Event) FilterText(target string) bool
- func (e *Event) HandleTypeMessage(ctx context.Context, f func(context.Context, *Event) error) error
- func (e *Event) HandleTypePostback(ctx context.Context, f func(context.Context, *Event) error) error
- func (e *Event) ReadTextLines() []string
- type Item
- type ListType
- type ShoppingItem
- type ShoppingItems
- type ShoppingReplyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType int
const ( ActionTypeUnknown ActionType = iota ActionTypeDelete )
type ConversationID ¶
type ConversationID string
func NewConversationID ¶
func NewConversationID(prefix, sourceID string) ConversationID
func (ConversationID) SourceID ¶
func (c ConversationID) SourceID() string
func (ConversationID) String ¶
func (c ConversationID) String() string
type ConversationStatus ¶
type ConversationStatus struct { ConversationID ConversationID Type ConversationStatusType }
func (*ConversationStatus) Validate ¶
func (m *ConversationStatus) Validate() error
type ConversationStatusType ¶
type ConversationStatusType int
const ( ConversationStatusTypeNeutral ConversationStatusType = iota ConversationStatusTypeShopping ConversationStatusTypeShoppingAdd )
type Event ¶
func (*Event) ConversationID ¶
func (e *Event) ConversationID() ConversationID
ConversationID returns conversation ID.
func (*Event) FilterText ¶
FilterText returns true if Event.Message contains target text.
func (*Event) HandleTypeMessage ¶
func (*Event) HandleTypePostback ¶
func (*Event) ReadTextLines ¶
ReadTextLines reads text lines from Event.Message and trim spaces per line.
type Item ¶
type Item struct { Indexes []int Name []string Action ActionType }
func (*Item) UniqueIndexes ¶
type ShoppingItem ¶
type ShoppingItem struct { ID string Name string Quantity int ConversationID ConversationID CreatedAt int64 Order int }
func (*ShoppingItem) Validate ¶
func (m *ShoppingItem) Validate() error
type ShoppingItems ¶
type ShoppingItems []*ShoppingItem
func (ShoppingItems) FilterByNames ¶
func (l ShoppingItems) FilterByNames(names []string) ShoppingItems
func (ShoppingItems) Print ¶
func (l ShoppingItems) Print(typ ListType) string
type ShoppingReplyType ¶
type ShoppingReplyType int
const ( ShoppingReplyTypeAll ShoppingReplyType = iota ShoppingReplyTypeEmptyList ShoppingReplyTypeWithoutView )
Click to show internal directories.
Click to hide internal directories.