diff --git a/modules/builder.go b/modules/builder.go index 2101b34023..81de578551 100644 --- a/modules/builder.go +++ b/modules/builder.go @@ -1,19 +1,17 @@ package modules import ( - fiftyonedegreesDevicedetection "github.com/prebid/prebid-server/v3/modules/fiftyonedegrees/devicedetection" prebidOrtb2blocking "github.com/prebid/prebid-server/v3/modules/prebid/ortb2blocking" ) // builders returns mapping between module name and its builder // vendor and module names are chosen based on the module directory name func builders() ModuleBuilders { - return ModuleBuilders{ - "fiftyonedegrees": { - "devicedetection": fiftyonedegreesDevicedetection.Builder, - }, + ret := ModuleBuilders{ "prebid": { "ortb2blocking": prebidOrtb2blocking.Builder, }, } + addFiftyonedegreesDevicedetection(ret) + return ret } diff --git a/modules/cgo.go b/modules/cgo.go new file mode 100644 index 0000000000..a6e2b51003 --- /dev/null +++ b/modules/cgo.go @@ -0,0 +1,14 @@ +//go:build cgo + +package modules + +import ( + fiftyonedegreesDevicedetection "github.com/prebid/prebid-server/v3/modules/fiftyonedegrees/devicedetection" +) + +func addFiftyonedegreesDevicedetection(b ModuleBuilders) { + if b["fiftyonedegrees"] == nil { + b["fiftyonedegrees"] = make(map[string]ModuleBuilderFn) + } + b["fiftyonedegrees"]["devicedetection"] = fiftyonedegreesDevicedetection.Builder +} diff --git a/modules/fiftyonedegrees/devicedetection/account_info_extractor.go b/modules/fiftyonedegrees/devicedetection/account_info_extractor.go index 2a5168cfe0..3961ec1137 100644 --- a/modules/fiftyonedegrees/devicedetection/account_info_extractor.go +++ b/modules/fiftyonedegrees/devicedetection/account_info_extractor.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/account_info_extractor_test.go b/modules/fiftyonedegrees/devicedetection/account_info_extractor_test.go index 2d32f7915b..76cb543c01 100644 --- a/modules/fiftyonedegrees/devicedetection/account_info_extractor_test.go +++ b/modules/fiftyonedegrees/devicedetection/account_info_extractor_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/account_validator.go b/modules/fiftyonedegrees/devicedetection/account_validator.go index fdff92531a..169850e551 100644 --- a/modules/fiftyonedegrees/devicedetection/account_validator.go +++ b/modules/fiftyonedegrees/devicedetection/account_validator.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import "slices" diff --git a/modules/fiftyonedegrees/devicedetection/account_validator_test.go b/modules/fiftyonedegrees/devicedetection/account_validator_test.go index 25f99e3b79..b3c943bf5a 100644 --- a/modules/fiftyonedegrees/devicedetection/account_validator_test.go +++ b/modules/fiftyonedegrees/devicedetection/account_validator_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/config.go b/modules/fiftyonedegrees/devicedetection/config.go index a5c302bcff..bcf61746d2 100644 --- a/modules/fiftyonedegrees/devicedetection/config.go +++ b/modules/fiftyonedegrees/devicedetection/config.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/config_test.go b/modules/fiftyonedegrees/devicedetection/config_test.go index e2478d82b7..9775eb7a10 100644 --- a/modules/fiftyonedegrees/devicedetection/config_test.go +++ b/modules/fiftyonedegrees/devicedetection/config_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/context.go b/modules/fiftyonedegrees/devicedetection/context.go index 3c10dd2f39..b16495ef1f 100644 --- a/modules/fiftyonedegrees/devicedetection/context.go +++ b/modules/fiftyonedegrees/devicedetection/context.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection // Context keys for device detection diff --git a/modules/fiftyonedegrees/devicedetection/device_detector.go b/modules/fiftyonedegrees/devicedetection/device_detector.go index 8369d343d3..39f086ea16 100644 --- a/modules/fiftyonedegrees/devicedetection/device_detector.go +++ b/modules/fiftyonedegrees/devicedetection/device_detector.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/device_detector_test.go b/modules/fiftyonedegrees/devicedetection/device_detector_test.go index 84d6ab28cc..c113aec7ac 100644 --- a/modules/fiftyonedegrees/devicedetection/device_detector_test.go +++ b/modules/fiftyonedegrees/devicedetection/device_detector_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/device_info_extractor.go b/modules/fiftyonedegrees/devicedetection/device_info_extractor.go index 1c913e2169..c1d185b860 100644 --- a/modules/fiftyonedegrees/devicedetection/device_info_extractor.go +++ b/modules/fiftyonedegrees/devicedetection/device_info_extractor.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/device_info_extractor_test.go b/modules/fiftyonedegrees/devicedetection/device_info_extractor_test.go index 197e392860..23bee8a5d5 100644 --- a/modules/fiftyonedegrees/devicedetection/device_info_extractor_test.go +++ b/modules/fiftyonedegrees/devicedetection/device_info_extractor_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/evidence_extractor.go b/modules/fiftyonedegrees/devicedetection/evidence_extractor.go index a99a921e75..2a3d36a98b 100644 --- a/modules/fiftyonedegrees/devicedetection/evidence_extractor.go +++ b/modules/fiftyonedegrees/devicedetection/evidence_extractor.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/evidence_extractor_test.go b/modules/fiftyonedegrees/devicedetection/evidence_extractor_test.go index 6b2f9b3ea8..7dc4fb9790 100644 --- a/modules/fiftyonedegrees/devicedetection/evidence_extractor_test.go +++ b/modules/fiftyonedegrees/devicedetection/evidence_extractor_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/fiftyone_device_types.go b/modules/fiftyonedegrees/devicedetection/fiftyone_device_types.go index 7237698117..2c95bc98e2 100644 --- a/modules/fiftyonedegrees/devicedetection/fiftyone_device_types.go +++ b/modules/fiftyonedegrees/devicedetection/fiftyone_device_types.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/fiftyone_device_types_test.go b/modules/fiftyonedegrees/devicedetection/fiftyone_device_types_test.go index 5fd0203bac..f8b91678a0 100644 --- a/modules/fiftyonedegrees/devicedetection/fiftyone_device_types_test.go +++ b/modules/fiftyonedegrees/devicedetection/fiftyone_device_types_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/hook_auction_entrypoint.go b/modules/fiftyonedegrees/devicedetection/hook_auction_entrypoint.go index 7597daa8e0..8be51c422d 100644 --- a/modules/fiftyonedegrees/devicedetection/hook_auction_entrypoint.go +++ b/modules/fiftyonedegrees/devicedetection/hook_auction_entrypoint.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go index 88d0686905..acde532eb5 100644 --- a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go +++ b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/models.go b/modules/fiftyonedegrees/devicedetection/models.go index c58daa211f..ffa9887235 100644 --- a/modules/fiftyonedegrees/devicedetection/models.go +++ b/modules/fiftyonedegrees/devicedetection/models.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection // Prefixes in literal format diff --git a/modules/fiftyonedegrees/devicedetection/models_test.go b/modules/fiftyonedegrees/devicedetection/models_test.go index 898f25f414..a2a251f425 100644 --- a/modules/fiftyonedegrees/devicedetection/models_test.go +++ b/modules/fiftyonedegrees/devicedetection/models_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/module.go b/modules/fiftyonedegrees/devicedetection/module.go index 80eed36efd..a4c459a78f 100644 --- a/modules/fiftyonedegrees/devicedetection/module.go +++ b/modules/fiftyonedegrees/devicedetection/module.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/module_test.go b/modules/fiftyonedegrees/devicedetection/module_test.go index eb59d01359..19595aca4e 100644 --- a/modules/fiftyonedegrees/devicedetection/module_test.go +++ b/modules/fiftyonedegrees/devicedetection/module_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/request_headers_extractor.go b/modules/fiftyonedegrees/devicedetection/request_headers_extractor.go index 8440886b35..7e36efa295 100644 --- a/modules/fiftyonedegrees/devicedetection/request_headers_extractor.go +++ b/modules/fiftyonedegrees/devicedetection/request_headers_extractor.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/request_headers_extractor_test.go b/modules/fiftyonedegrees/devicedetection/request_headers_extractor_test.go index 77fbed3a42..8cde22c89d 100644 --- a/modules/fiftyonedegrees/devicedetection/request_headers_extractor_test.go +++ b/modules/fiftyonedegrees/devicedetection/request_headers_extractor_test.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/fiftyonedegrees/devicedetection/sua_payload_extractor.go b/modules/fiftyonedegrees/devicedetection/sua_payload_extractor.go index ab69210449..967ef24d93 100644 --- a/modules/fiftyonedegrees/devicedetection/sua_payload_extractor.go +++ b/modules/fiftyonedegrees/devicedetection/sua_payload_extractor.go @@ -1,3 +1,5 @@ +//go:build cgo + package devicedetection import ( diff --git a/modules/no-cgo.go b/modules/no-cgo.go new file mode 100644 index 0000000000..8e58a3ac24 --- /dev/null +++ b/modules/no-cgo.go @@ -0,0 +1,7 @@ +//go:build !cgo + +package modules + +func addFiftyonedegreesDevicedetection(b ModuleBuilders) { + // Do nothing - fiftyonedegrees module is not supported without cgo +}