processor

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessorQueueGroup  = "processor"
	ReplyReceivedSubject = "processor.reply.received"
)
View Source
const (
	DatabaseName               = "processor"
	CommandCollectionName      = "commands"
	CommandEventCollectionName = "commandevents"
	ReplyCollectionName        = "replies"
)
View Source
const (
	RequestReceivedSubject = "request.received"
)

Variables

This section is empty.

Functions

func NewService

func NewService(queue *nats.EncodedConn, storage Storage) (processing.ProcessingServer, error)

Types

type Client added in v1.3.0

type Client struct{}

func (Client) Do added in v1.3.0

func (c Client) Do(command Command) (*processing.Response, error)

type Command added in v1.3.0

type Command struct {
	Id      string                    `json:"id"`
	Request processing.MessageRequest `json:"request"`
	Intent  intent.Intent             `json:"intent"`
}

func (Command) Execute added in v1.3.0

func (c Command) Execute() (*processing.Response, error)

func (Command) IsMatch added in v1.4.0

func (c Command) IsMatch() (bool, error)

type CommandEvent added in v1.3.0

type CommandEvent struct {
	CommandId   string `json:"commandId"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Timestamp   int64  `json:"timestamp"`
}

type Processor added in v1.3.0

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

func New added in v1.3.0

func New(logger zerolog.Logger, queue *nats.EncodedConn, registry intent.IntentRegistryClient, storage Storage) Processor

func (Processor) Start added in v1.3.0

func (p Processor) Start() error

func (Processor) Stop added in v1.3.0

func (p Processor) Stop()

type Storage added in v1.3.0

type Storage struct {
	Session                *mgo.Session
	CommandCollection      *mgo.Collection
	CommandEventCollection *mgo.Collection
	ReplyCollection        *mgo.Collection
}

func NewStorage added in v1.3.0

func NewStorage(url string) (Storage, error)

func (Storage) Close added in v1.3.0

func (s Storage) Close()

func (Storage) Command added in v1.3.0

func (s Storage) Command(id string) (Command, error)

func (Storage) CommandEvents added in v1.3.0

func (s Storage) CommandEvents(id string) ([]CommandEvent, error)

func (Storage) MessageReply added in v1.4.0

func (s Storage) MessageReply(id string) (*processing.MessageReply, error)

func (Storage) SaveCommand added in v1.3.0

func (s Storage) SaveCommand(c Command) error

func (Storage) SaveCommandEvent added in v1.3.0

func (s Storage) SaveCommandEvent(e CommandEvent) error

func (Storage) SaveMessageReply added in v1.4.0

func (s Storage) SaveMessageReply(r processing.MessageReply) error

Jump to

Keyboard shortcuts

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