Skip to content

Commit

Permalink
[dev] added options for SendWithCallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
shaazmik committed Oct 12, 2024
1 parent 9baa9c5 commit cb09ec5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion driver/generic/sendwithcallbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,20 @@ func (d *Driver) SendWithCallbacks(
input string,
callbacks []*Callback,
timeout time.Duration,
opts ...util.Option,
) (*response.Response, error) {
d.Logger.Info("SendWithCallbacks requested")

r := response.NewResponse(input, d.Transport.GetHost(), d.Transport.GetPort(), nil)
driverOpts, err := NewOperation(opts...)
if err != nil {
return nil, err
}

if len(driverOpts.FailedWhenContains) == 0 {
driverOpts.FailedWhenContains = d.FailedWhenContains
}

r := response.NewResponse(input, d.Transport.GetHost(), d.Transport.GetPort(), driverOpts.FailedWhenContains)

if input != "" {
err := d.Channel.WriteAndReturn([]byte(input), false)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ require (
)

require golang.org/x/sys v0.23.0 // indirect

0 comments on commit cb09ec5

Please sign in to comment.