File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ func (e InvalidDatabaseError) Error() string {
26
26
// UnmarshalTypeError is returned when the value in the database cannot be
27
27
// assigned to the specified data type.
28
28
type UnmarshalTypeError struct {
29
- Value string // stringified copy of the database value that caused the error
30
- Type reflect. Type // type of the value that could not be assign to
29
+ Type reflect. Type
30
+ Value string
31
31
}
32
32
33
33
func newUnmarshalTypeError (value interface {}, rType reflect.Type ) UnmarshalTypeError {
Original file line number Diff line number Diff line change @@ -25,28 +25,28 @@ var metadataStartMarker = []byte("\xAB\xCD\xEFMaxMind.com")
25
25
// All of the methods on Reader are thread-safe. The struct may be safely
26
26
// shared across goroutines.
27
27
type Reader struct {
28
- hasMappedFile bool
29
- buffer []byte
30
28
nodeReader nodeReader
29
+ buffer []byte
31
30
decoder decoder
32
31
Metadata Metadata
33
32
ipv4Start uint
34
33
ipv4StartBitDepth int
35
34
nodeOffsetMult uint
35
+ hasMappedFile bool
36
36
}
37
37
38
38
// Metadata holds the metadata decoded from the MaxMind DB file. In particular
39
39
// it has the format version, the build time as Unix epoch time, the database
40
40
// type and description, the IP version supported, and a slice of the natural
41
41
// languages included.
42
42
type Metadata struct {
43
+ Description map [string ]string `maxminddb:"description"`
44
+ DatabaseType string `maxminddb:"database_type"`
45
+ Languages []string `maxminddb:"languages"`
43
46
BinaryFormatMajorVersion uint `maxminddb:"binary_format_major_version"`
44
47
BinaryFormatMinorVersion uint `maxminddb:"binary_format_minor_version"`
45
48
BuildEpoch uint `maxminddb:"build_epoch"`
46
- DatabaseType string `maxminddb:"database_type"`
47
- Description map [string ]string `maxminddb:"description"`
48
49
IPVersion uint `maxminddb:"ip_version"`
49
- Languages []string `maxminddb:"languages"`
50
50
NodeCount uint `maxminddb:"node_count"`
51
51
RecordSize uint `maxminddb:"record_size"`
52
52
}
Original file line number Diff line number Diff line change @@ -14,11 +14,10 @@ type netNode struct {
14
14
15
15
// Networks represents a set of subnets that we are iterating over.
16
16
type Networks struct {
17
- reader * Reader
18
- nodes []netNode // Nodes we still have to visit.
19
- lastNode netNode
20
- err error
21
-
17
+ err error
18
+ reader * Reader
19
+ nodes []netNode
20
+ lastNode netNode
22
21
skipAliasedNetworks bool
23
22
}
24
23
You can’t perform that action at this time.
0 commit comments