handler

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnhandledMessage runhandled message from nebula example handler
	ErrUnhandledMessage = errors.New("unhandled message from nebula example handler")

	// ErrItemNotFound item not found
	ErrItemNotFound = errors.New("item not found")
)

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
}

MessageCache

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(options HandlerOptions) *Handler

func (*Handler) EntityResponseMessage

func (h *Handler) EntityResponseMessage(er *sdkinterfaces.EntityResponse) error

func (*Handler) HandleActionItem

func (h *Handler) HandleActionItem(insight *sdkinterfaces.Insight, number int) error

func (*Handler) HandleFollowUp

func (h *Handler) HandleFollowUp(insight *sdkinterfaces.Insight, number int) error

func (*Handler) HandleQuestion

func (h *Handler) HandleQuestion(insight *sdkinterfaces.Insight, number int) error

func (*Handler) InitializedConversation

func (h *Handler) InitializedConversation(im *sdkinterfaces.InitializationMessage) error

func (*Handler) InsightResponseMessage

func (h *Handler) InsightResponseMessage(ir *sdkinterfaces.InsightResponse) error

func (*Handler) MessageResponseMessage

func (h *Handler) MessageResponseMessage(mr *sdkinterfaces.MessageResponse) error

func (*Handler) RecognitionResultMessage

func (h *Handler) RecognitionResultMessage(rr *sdkinterfaces.RecognitionResult) error

func (*Handler) TeardownConversation

func (h *Handler) TeardownConversation(tm *sdkinterfaces.TeardownMessage) error

func (*Handler) TopicResponseMessage

func (h *Handler) TopicResponseMessage(tr *sdkinterfaces.TopicResponse) error

func (*Handler) TrackerResponseMessage

func (h *Handler) TrackerResponseMessage(tr *sdkinterfaces.TrackerResponse) error

func (*Handler) UnhandledMessage

func (h *Handler) UnhandledMessage(byMsg []byte) error

func (*Handler) UserDefinedMessage

func (h *Handler) UserDefinedMessage(data []byte) error

type HandlerOptions

type HandlerOptions struct {
	NebulaClient *nebula.Client
}

Handler for messages

type Message

type Message struct {
	ID     string
	Text   string
	Author Author
}

type MessageCache

type MessageCache struct {
	// contains filtered or unexported fields
}

func NewMessageCache

func NewMessageCache() *MessageCache

func (*MessageCache) Find

func (mc *MessageCache) Find(msgId string) (*Message, error)

func (*MessageCache) Push

func (mc *MessageCache) Push(msgId, text, name, email string) error

func (*MessageCache) ReturnConversation

func (mc *MessageCache) ReturnConversation() string

Jump to

Keyboard shortcuts

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