forked from hdczsf/51degrees.go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcommon_test.go
27 lines (22 loc) · 968 Bytes
/
common_test.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
package fiftyonedegrees
import (
"fmt"
)
func mustLoadProviderData(poolSize int, cacheSize int) (*FiftyoneDegreesProvider, error) {
properties := "DeviceType, IsMobile, IsSmartPhone, IsTablet, IsTv, HardwareName, HardwareVendor, HardwareModel, BrowserName, BrowserVersion, PlatformName, PlatformVersion, ScreenPixelsWidth, ScreenPixelsHeight"
item, err := NewFiftyoneDegreesProvider("51Degrees-LiteV3.2.dat", properties, poolSize, cacheSize)
if err != nil {
fmt.Println("err=", err)
return nil, err
}
return item, nil
}
func mustLoadDataSet() (*FiftyoneDegreesDataSet, error) {
properties := "DeviceType, IsMobile, IsSmartPhone, IsTablet, IsTv, HardwareName, HardwareVendor, HardwareModel, BrowserName, BrowserVersion, PlatformName, PlatformVersion, ScreenPixelsWidth, ScreenPixelsHeight"
item, err := NewFiftyoneDegreesDataSet("51Degrees-LiteV3.2.dat", properties)
if err != nil {
fmt.Println("err=", err)
return nil, err
}
return item, nil
}