forked from mxmCherry/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnection_type.go
29 lines (25 loc) · 1.04 KB
/
connection_type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package openrtb
// 5.22 Connection Type
//
// Various options for the type of device connectivity.
type ConnectionType int8
const (
ConnectionTypeUnknown ConnectionType = 0 // Unknown
ConnectionTypeEthernet ConnectionType = 1 // Ethernet
ConnectionTypeWIFI ConnectionType = 2 // WIFI
ConnectionTypeCellularNetworkUnknownGeneration ConnectionType = 3 // Cellular Network – Unknown Generation
ConnectionTypeCellularNetwork2G ConnectionType = 4 // Cellular Network – 2G
ConnectionTypeCellularNetwork3G ConnectionType = 5 // Cellular Network – 3G
ConnectionTypeCellularNetwork4G ConnectionType = 6 // Cellular Network – 4G
)
// Ptr returns pointer to own value.
func (t ConnectionType) Ptr() *ConnectionType {
return &t
}
// Val safely dereferences pointer, returning default value (ConnectionTypeUnknown) for nil.
func (t *ConnectionType) Val() ConnectionType {
if t == nil {
return ConnectionTypeUnknown
}
return *t
}