Skip to content

Commit

Permalink
refactor(plc4go/spi): reorder methods for options
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jun 21, 2023
1 parent 2e65a27 commit 1e2298b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plc4go/spi/options/Option.go
Expand Up @@ -59,6 +59,17 @@ func WithPassLoggerToModel(passLogger bool) WithOption {
return withPassLoggerToModel{passLogger: passLogger}
}

// ExtractPassLoggerToModel to extract the flag indicating that model should be passed to Model
func ExtractPassLoggerToModel(options ...WithOption) (passLogger bool) {
for _, option := range options {
switch option := option.(type) {
case withPassLoggerToModel:
passLogger = option.passLogger
}
}
return
}

// WithReceiveTimeout set's a timeout for a receive-operation (similar to SO_RCVTIMEO)
func WithReceiveTimeout(timeout time.Duration) WithOption {
return withReceiveTimeout{timeout: timeout}
Expand All @@ -76,17 +87,6 @@ func ExtractReceiveTimeout(options ...WithOption) (receiveDuration time.Duration
return
}

// ExtractPassLoggerToModel to extract the flag indicating that model should be passed to Model
func ExtractPassLoggerToModel(options ...WithOption) (passLogger bool) {
for _, option := range options {
switch option := option.(type) {
case withPassLoggerToModel:
passLogger = option.passLogger
}
}
return
}

// WithTraceTransactionManagerWorkers enables trace transaction manager workers
func WithTraceTransactionManagerWorkers(traceWorkers bool) WithOption {
return withTraceTransactionManagerWorkers{traceWorkers: traceWorkers}
Expand Down

0 comments on commit 1e2298b

Please sign in to comment.