Skip to content

Commit

Permalink
Conditionally configure fiftyonedegrees.
Browse files Browse the repository at this point in the history
  • Loading branch information
scr-oath committed Dec 17, 2024
1 parent 0a42c8d commit a54644a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
8 changes: 3 additions & 5 deletions modules/builder.go
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 14 additions & 0 deletions modules/cgo.go
Original file line number Diff line number Diff line change
@@ -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
}
13 changes: 0 additions & 13 deletions modules/fiftyonedegrees/devicedetection/no_cgo.go

This file was deleted.

7 changes: 7 additions & 0 deletions modules/no-cgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build !cgo

package modules

func addFiftyonedegreesDevicedetection(b ModuleBuilders) {
// Do nothing - fiftyonedegrees module is not supported without cgo
}

0 comments on commit a54644a

Please sign in to comment.