Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventPublisherInterface ¶
type EventPublisherInterface interface { PublishTaskEvent(event TaskEvent) error PublishRobotEvent(event RobotEvent) error }
EventPublisherInterface defines contract for event publishers
func NewEventPublisherService ¶
func NewEventPublisherService( logger *zap.SugaredLogger, robotBrokerService robotbroker.RobotBrokerInterface) (EventPublisherInterface, error)
NewEventPublisherService creates a concerete instance of EventPublisherInterface
type MoveRobotRequestMoveSequence ¶
type MoveRobotRequestMoveSequence string
MoveRobotRequestMoveSequence describes a movement code
const ( // EAST denotes a movement code towards EAST EAST MoveRobotRequestMoveSequence = "E" // NORTH denotes a movement code towards NORTH NORTH MoveRobotRequestMoveSequence = "N" // SOUTH denotes a movement code towards SOUTH SOUTH MoveRobotRequestMoveSequence = "S" // WEST denotes a movement code towards WEST WEST MoveRobotRequestMoveSequence = "W" )
type RobotEvent ¶
type RobotEvent struct { EventType RobotMovedEventType `json:"EventType"` Id int64 `json:"Id"` Data RobotData `json:"Data,omitempty"` ErrorMessage string `json:"ErrorMessage,omitempty"` }
RobotEvent describe a RobotEvent
type RobotMovedEventType ¶
type RobotMovedEventType string
RobotMovedEventType descries a robot movement event type
const ( // RobotMoved is used when a RobotMoved RobotMoved RobotMovedEventType = "Moved" // RobotFailedToMove is used when a RobotFailedToMove RobotFailedToMove RobotMovedEventType = "FailedToMove" )
type TaskData ¶
type TaskData struct { RobotId int64 `json:"RobotId"` MoveSequeneces []MoveRobotRequestMoveSequence `json:"MoveSequeneces"` }
TaskData describes task data
type TaskEvent ¶
type TaskEvent struct { EventType TaskEventType `json:"EventType"` Id int `json:"Id"` Data TaskData `json:"Data,omitempty"` }
TaskEvent describes a task event
type TaskEventType ¶
type TaskEventType string
TaskEventType describe task state
const ( // TaskCreated is used to denote a task event that is Created TaskCreated TaskEventType = "Created" // TaskCompleted is used to denote a task event that is Completed TaskCompleted TaskEventType = "Completed" // TaskCancelled is used to denote a task event that is Cancelled TaskCancelled TaskEventType = "Cancelled" )
Click to show internal directories.
Click to hide internal directories.