Documentation
¶
Overview ¶
Package mesgtest is a testing package for MESG application. Use this package while unit testing your programs.
Index ¶
- Variables
- type EventListen
- type Execute
- type ResultListen
- type Server
- func (s *Server) Close() error
- func (s *Server) EmitEvent(serviceID, event string, data interface{}) error
- func (s *Server) EmitResult(serviceID, task, outputKey string, data interface{}, executionTags []string) error
- func (s *Server) LastEventListen() <-chan *EventListen
- func (s *Server) LastExecute() <-chan *Execute
- func (s *Server) LastResultListen() <-chan *ResultListen
- func (s *Server) LastServiceStart() <-chan *ServiceStart
- func (s *Server) MarkServiceAsNonExistent(id string)
- func (s *Server) Socket() *Socket
- func (s *Server) Start() error
- type ServiceStart
- type Socket
Constants ¶
This section is empty.
Variables ¶
var ErrServiceDoesNotExists = errors.New("service does not exists")
ErrServiceDoesNotExists returned when a service is not exists during service start.
Functions ¶
This section is empty.
Types ¶
type EventListen ¶
type EventListen struct {
// contains filtered or unexported fields
}
EventListen holds information about an event listen request.
func (*EventListen) EventFilter ¶
func (l *EventListen) EventFilter() string
EventFilter returns the event name.
func (*EventListen) ServiceID ¶
func (l *EventListen) ServiceID() string
ServiceID returns the id of service that events are emitted from.
type Execute ¶
type Execute struct {
// contains filtered or unexported fields
}
Execute holds information about a task execution.
type ResultListen ¶
type ResultListen struct {
// contains filtered or unexported fields
}
ResultListen holds information about a result listen request.
func (*ResultListen) KeyFilter ¶
func (l *ResultListen) KeyFilter() string
KeyFilter returns the output key name.
func (*ResultListen) ServiceID ¶
func (l *ResultListen) ServiceID() string
ServiceID returns the id of service that results are emitted from.
func (*ResultListen) Tags ¶
func (l *ResultListen) Tags() []string
Tags returns the execution tags filter.
func (*ResultListen) TaskFilter ¶
func (l *ResultListen) TaskFilter() string
TaskFilter returns the task key name.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a test server.
func (*Server) EmitResult ¶
func (s *Server) EmitResult(serviceID, task, outputKey string, data interface{}, executionTags []string) error
EmitResult emits a new task result for serviceID with given outputKey and data.
func (*Server) LastEventListen ¶
func (s *Server) LastEventListen() <-chan *EventListen
LastEventListen returns the chan that receives last event listen request's info.
func (*Server) LastExecute ¶
LastExecute returns the chan that receives last task execution's info.
func (*Server) LastResultListen ¶
func (s *Server) LastResultListen() <-chan *ResultListen
LastResultListen returns the chan that receives last result listen request's info.
func (*Server) LastServiceStart ¶
func (s *Server) LastServiceStart() <-chan *ServiceStart
LastServiceStart returns the chan that receives last service start request's info.
func (*Server) MarkServiceAsNonExistent ¶
MarkServiceAsNonExistent marks a service id as non-exists server.
type ServiceStart ¶
type ServiceStart struct {
// contains filtered or unexported fields
}
ServiceStart holds information about a service start request.
func (*ServiceStart) ServiceID ¶
func (s *ServiceStart) ServiceID() string
ServiceID returns the started service's id.