Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingOperatorFunc = errors.New("missing operator function")
Functions ¶
This section is empty.
Types ¶
type Initiator ¶
type Initiator struct {
// contains filtered or unexported fields
}
Initiator is a mock implementation of the orbital.Initiator interface.
func NewInitiator ¶
func NewInitiator(f OperatorFunc, opts *Opts) (*Initiator, error)
NewInitiator creates a new Initiator instance. It expects an OperatorFunc which is used to simulate the behavior of an operator. It allows options to configure the buffer size of the link channel.
func (*Initiator) ReceiveTaskResponse ¶
ReceiveTaskResponse waits for a task response from the link channel and returns it.
func (*Initiator) SendTaskRequest ¶
SendTaskRequest passes a task request to the operator function and sends the response to the link channel.
type OperatorFunc ¶
type OperatorFunc func(context.Context, orbital.TaskRequest) (orbital.TaskResponse, error)
OperatorFunc is a function type that simulates the behavior of an operator.
type Option ¶
type Option func(*config)
Option is a function that modifies the config parameter of the Responder.
func WithInputBufferSize ¶
WithInputBufferSize sets the input buffer size for the Responder.
func WithOutputBufferSize ¶
WithOutputBufferSize sets the output buffer size for the Responder.
type Responder ¶
type Responder struct {
// contains filtered or unexported fields
}
Responder is a mock implementation of the operator.Responder interface.
func NewResponder ¶
NewResponder creates a new Responder instance. It allows options to configure the buffer size of the input and output channel.
func (*Responder) NewRequest ¶
func (r *Responder) NewRequest(req orbital.TaskRequest)
NewRequest sends the task request to the input channel.
func (*Responder) NewResponse ¶
func (r *Responder) NewResponse() orbital.TaskResponse
NewResponse receives the task response from the output channel.
func (*Responder) ReceiveTaskRequest ¶
ReceiveTaskRequest receives a task request from the input channel.
func (*Responder) SendTaskResponse ¶
SendTaskResponse sends a task response to the output channel.