mirror of
https://github.com/prebid/openrtb.git
synced 2026-06-14 22:16:41 +03:00
Ptr helpers for enum types
This commit is contained in:
@@ -18,3 +18,8 @@ const (
|
||||
AdPositionSidebar AdPosition = 6 // Sidebar
|
||||
AdPositionFullScreen AdPosition = 7 // Full Screen
|
||||
)
|
||||
|
||||
// PtrAdPosition returns pointer to passed argument.
|
||||
func PtrAdPosition(p AdPosition) *AdPosition {
|
||||
return &p
|
||||
}
|
||||
|
||||
@@ -14,3 +14,8 @@ const (
|
||||
ConnectionTypeCellularNetwork3G ConnectionType = 5 // Cellular Network – 3G
|
||||
ConnectionTypeCellularNetwork4G ConnectionType = 6 // Cellular Network – 4G
|
||||
)
|
||||
|
||||
// PtrConnectionType returns pointer to passed argument.
|
||||
func PtrConnectionType(t ConnectionType) *ConnectionType {
|
||||
return &t
|
||||
}
|
||||
|
||||
@@ -18,3 +18,8 @@ const (
|
||||
NoBidReasonCodeDailyReaderCapMet NoBidReasonCode = 9 // Daily Reader Cap Met
|
||||
NoBidReasonCodeDailyDomainCapMet NoBidReasonCode = 10 // Daily Domain Cap Met
|
||||
)
|
||||
|
||||
// PtrNoBidReasonCode returns pointer to passed argument.
|
||||
func PtrNoBidReasonCode(c NoBidReasonCode) *NoBidReasonCode {
|
||||
return &c
|
||||
}
|
||||
|
||||
@@ -12,3 +12,8 @@ const (
|
||||
ProductionQualityProsumer ProductionQuality = 2 // Prosumer
|
||||
ProductionQualityUserGenerated ProductionQuality = 3 // User Generated (UGC)
|
||||
)
|
||||
|
||||
// PtrProductionQuality returns pointer to passed argument.
|
||||
func PtrProductionQuality(q ProductionQuality) *ProductionQuality {
|
||||
return &q
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package openrtb
|
||||
|
||||
// PtrInt8 returns pointer to passed number argument.
|
||||
func PtrInt8(n int8) *int8 { return &n }
|
||||
// PtrInt8 returns pointer to passed argument.
|
||||
func PtrInt8(n int8) *int8 {
|
||||
return &n
|
||||
}
|
||||
|
||||
// PtrUint64 returns pointer to passed number argument.
|
||||
func PtrUint64(n uint64) *uint64 { return &n }
|
||||
// PtrUint64 returns pointer to passed argument.
|
||||
func PtrUint64(n uint64) *uint64 {
|
||||
return &n
|
||||
}
|
||||
|
||||
@@ -13,3 +13,8 @@ const (
|
||||
StartDelayGenericMidRoll StartDelay = -1 // Generic Mid-Roll
|
||||
StartDelayGenericPostRoll StartDelay = -2 // Generic Post-Roll
|
||||
)
|
||||
|
||||
// PtrStartDelay returns pointer to passed argument.
|
||||
func PtrStartDelay(d StartDelay) *StartDelay {
|
||||
return &d
|
||||
}
|
||||
|
||||
@@ -12,3 +12,8 @@ const (
|
||||
VolumeNormalizationModeAdLoudnessNormalizedToContent VolumeNormalizationMode = 3 // Ad Loudness Normalized to Content
|
||||
VolumeNormalizationModeCustomVolumeNormalizationMode VolumeNormalizationMode = 4 // Custom Volume Normalization
|
||||
)
|
||||
|
||||
// PtrVolumeNormalizationMode returns pointer to passed argument.
|
||||
func PtrVolumeNormalizationMode(m VolumeNormalizationMode) *VolumeNormalizationMode {
|
||||
return &m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user