You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/06/21 14:37:30 UTC

[plc4x] 01/02: refactor(plc4go/spi): reorder methods for options

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 1e2298b3d8d82855eb3a4bca0fec2953c5dc6cab
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Jun 21 14:11:51 2023 +0200

    refactor(plc4go/spi): reorder methods for options
---
 plc4go/spi/options/Option.go | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/plc4go/spi/options/Option.go b/plc4go/spi/options/Option.go
index 6dede787b0..94a89875ec 100644
--- a/plc4go/spi/options/Option.go
+++ b/plc4go/spi/options/Option.go
@@ -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}
@@ -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}