MCPcopy Create free account

hub / github.com/oschwald/maxminddb-golang / functions

Functions386 in github.com/oschwald/maxminddb-golang

↓ 2 callersMethoddecodeSlice
( size uint, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:820
↓ 2 callersMethoddecodeUint128
DecodeUint128 decodes a 128-bit unsigned integer from the given offset. Returns the value as high and low 64-bit unsigned integers.
internal/decoder/data_decoder.go:373
↓ 2 callersMethoddecodeValueImpl
( offset uint, result addressableValue, depth int, checkUnmarshaler bool, )
internal/decoder/reflection.go:277
↓ 2 callersFunctioninvalidMaxMindDBTagError
(fieldName string)
internal/decoder/reflection.go:1198
↓ 2 callersFunctionmakeStructFieldsWithStack
( rootType reflect.Type, stack map[reflect.Type]bool, )
internal/decoder/reflection.go:1297
↓ 2 callersFunctionmakeTestName
Helper function to create reasonable test names from potentially long hex strings.
internal/decoder/decoder_test.go:24
↓ 2 callersFunctionmayImplementUnmarshaler
(t reflect.Type)
internal/decoder/reflection.go:1246
↓ 2 callersFunctionpowBigInt
No pow or bit shifting for big int, apparently :-( This is _not_ meant to be a comprehensive power function.
internal/decoder/reflection_test.go:542
↓ 2 callersFunctionreadNodePairBySize
readNodePairBySize reads both left (bit=0) and right (bit=1) child pointers for a node at the given base offset according to the record size. This red
reader.go:470
↓ 2 callersMethodresolveCtrlData
resolveCtrlData resolves at most one pointer starting at offset and returns the control data for the non-pointer value. Unlike decodeCtrlData, which r
internal/decoder/decoder.go:438
↓ 2 callersMethodresolveDataPointer
(pointer uint)
reader.go:789
↓ 2 callersFunctiontestFile
(file string)
internal/decoder/reflection_test.go:605
↓ 2 callersMethodtryDecodePointerStructWithFields
( offset uint, result addressableValue, depth int, fields *fieldsType, )
internal/decoder/reflection.go:1004
↓ 2 callersMethodtryDecodeStructWithFields
( offset uint, result addressableValue, depth int, fields *fieldsType, )
internal/decoder/reflection.go:958
↓ 2 callersFunctionuintFromBytes
(prefix uint, uintBytes []byte)
internal/decoder/data_decoder.go:579
↓ 2 callersFunctionv4ToV16
We store IPv4 addresses at ::/96 for unclear reasons.
traverse.go:269
↓ 2 callersFunctionvalidateTag
validateTag performs basic validation of maxminddb struct tags.
internal/decoder/reflection.go:1186
↓ 2 callersMethodverifyDataSectionSeparator
()
verifier.go:129
↓ 2 callersMethodwrapErrorWithMapKey
wrapErrorWithMapKey wraps an error with map key context, building path retroactively. Zero allocation on happy path - only allocates when error != nil
internal/decoder/reflection.go:208
↓ 2 callersFunctionwrapErrorWithPath
(err error, prepend func(*mmdberrors.PathBuilder))
internal/decoder/reflection.go:222
↓ 1 callersMethodBuildPath
BuildPath constructs a path string for the current decoder state. This is only called when an error occurs, so allocation is acceptable.
internal/mmdberrors/context.go:35
↓ 1 callersMethodError
()
internal/mmdberrors/errors.go:28
↓ 1 callersFunctionIncludeAliasedNetworks
IncludeAliasedNetworks is an option for Networks and NetworksWithin that makes them iterate over aliases of the IPv4 subtree in an IPv6 database, e.g.
traverse.go:36
↓ 1 callersMethodIs
(target error)
mmap_unix.go:18
↓ 1 callersMethodOffset
Offset returns the current offset position in the database. If the current position points to a pointer, this method resolves one pointer and returns
internal/decoder/decoder.go:332
↓ 1 callersMethodReadFloat32
ReadFloat32 reads the value pointed by the decoder as a float32. Returns an error if the database is malformed or if the pointed value is not a float
internal/decoder/decoder.go:91
↓ 1 callersMethodReadInt32
ReadInt32 reads the value pointed by the decoder as an int32. Returns an error if the database is malformed or if the pointed value is not an int32.
internal/decoder/decoder.go:127
↓ 1 callersMethodVerifyDataSection
VerifyDataSection verifies the data section against the provided offsets from the tree.
internal/decoder/verifier.go:11
↓ 1 callersFunctionbadDataFile
(file string)
reader_test.go:1409
↓ 1 callersFunctioncachedFieldsForType
(resultType reflect.Type)
internal/decoder/reflection.go:1264
↓ 1 callersFunctioncheckDecodingToInterface
(t *testing.T, recordInterface any)
reader_test.go:268
↓ 1 callersFunctiondecodeBool
(size, offset uint)
internal/decoder/data_decoder.go:575
↓ 1 callersMethoddecodeBytes
decodeBytes decodes a byte slice from the given offset with the given size.
internal/decoder/data_decoder.go:181
↓ 1 callersMethoddecodeFromType
( dtype Kind, size uint, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:375
↓ 1 callersMethoddecodePointerKeyFast
decodePointerKeyFast is an allocation-free inline of decodePointer followed by decodeKey for the dominant case of a map key encoded as a pointer to a
internal/decoder/data_decoder.go:416
↓ 1 callersMethoddecodePointerStructWithFields
( size uint, dataOffset uint, pointerEndOffset uint, result addressableValue, decodeDepth int, fields *f
internal/decoder/reflection.go:1069
↓ 1 callersMethoddecodeStruct
( size uint, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:854
↓ 1 callersMethodfieldByIndex
fieldByIndex efficiently accesses a field by its index path, initializing embedded pointers as needed.
internal/decoder/reflection.go:1547
↓ 1 callersMethodfinishMapAfterStop
(keyEndOffset, remainingPairs uint)
internal/decoder/decoder.go:354
↓ 1 callersMethodfinishSliceAfterStop
(currentOffset, remainingValues uint)
internal/decoder/decoder.go:372
↓ 1 callersFunctiongetEmbeddedStructType
getEmbeddedStructType returns the struct type for embedded fields. Returns nil if the field is not an embeddable struct type.
internal/decoder/reflection.go:1207
↓ 1 callersFunctionhandleEmbeddedField
handleEmbeddedField processes an embedded struct field and returns true if the field should be skipped.
internal/decoder/reflection.go:1218
↓ 1 callersMethodhasIPv4Subtree
()
reader.go:436
↓ 1 callersMethodindirect
indirect handles pointer dereferencing and initialization.
internal/decoder/reflection.go:1570
↓ 1 callersMethodipv4PrefixLen
(prefixLen int)
result.go:147
↓ 1 callersFunctionisFastDecodeType
isFastDecodeType determines if a field type can use optimized decode paths.
internal/decoder/reflection.go:1517
↓ 1 callersMethodlookupPointer
(ip netip.Addr)
reader.go:442
↓ 1 callersFunctionmakeAddressable
makeAddressable converts a reflect.Value to addressableValue, short-circuiting the reflect.New allocation when the value is already addressable. Non-a
internal/decoder/reflection.go:1507
↓ 1 callersFunctionmakeTestStrings
()
internal/decoder/reflection_test.go:440
↓ 1 callersMethodmethod
()
reader_test.go:419
↓ 1 callersFunctionmmap
(_, _ int)
mmap_stub.go:19
↓ 1 callersFunctionopenFallback
(f *os.File, size int)
reader.go:295
↓ 1 callersFunctionopenMmap
(f *os.File, size int)
reader.go:280
↓ 1 callersFunctionparseSimpleInt
parseSimpleInt converts numeric strings to integers with bounds checking. Returns the integer and true if valid, or 0 and false if not a simple intege
fuzz_test.go:355
↓ 1 callersFunctionrandomIPv6Address
(r *rand.Rand, ip []byte)
reader_test.go:1727
↓ 1 callersMethodreadBytes
(kind Kind)
internal/decoder/decoder.go:467
↓ 1 callersMethodreindex
reindex optimizes field indices to avoid bounds checks during runtime. This follows the json/v2 pattern of splitting the first index from the remainde
internal/decoder/reflection.go:1483
↓ 1 callersMethodsetIPv4Start
()
reader.go:420
↓ 1 callersMethodtryFastDecodeTyped
tryFastDecodeTyped returns (newOffset, true) on success and (0, false) on any failure: a malformed buffer, a DB-type/Go-kind mismatch, or an inner dec
internal/decoder/reflection.go:1591
↓ 1 callersFunctionunexpectedKindErr
(expectedKind, actualKind Kind)
internal/decoder/decoder.go:409
↓ 1 callersMethodunmarshalBool
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:415
↓ 1 callersMethodunmarshalBytes
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:441
↓ 1 callersMethodunmarshalFloat32
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:467
↓ 1 callersMethodunmarshalFloat64
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:490
↓ 1 callersMethodunmarshalInt32
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:516
↓ 1 callersMethodunmarshalMap
( size uint, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:557
↓ 1 callersMethodunmarshalPointer
( size, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:583
↓ 1 callersMethodunmarshalSlice
( size uint, offset uint, result addressableValue, depth int, )
internal/decoder/reflection.go:609
↓ 1 callersMethodunmarshalString
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:634
↓ 1 callersMethodunmarshalUint128
( size, offset uint, result addressableValue, )
internal/decoder/reflection.go:742
↓ 1 callersFunctionunwrapPtrType
unwrapPtrType strips all pointer indirection from t and returns the underlying element type. Used to find the addressable receiver type that mayImplem
internal/decoder/reflection.go:1538
↓ 1 callersFunctionvalidateRawMaxMindDBTagValue
(field reflect.StructField, rawTag string)
internal/decoder/reflection.go:1460
↓ 1 callersMethodvalueEndOffsetAfterYield
(valueOffset uint)
internal/decoder/decoder.go:389
↓ 1 callersMethodverifyDatabase
()
verifier.go:104
↓ 1 callersMethodverifyMetadata
()
verifier.go:41
↓ 1 callersMethodverifySearchTree
()
verifier.go:117
↓ 1 callersMethodwrapError
wrapError wraps an error with context information when an error occurs. Zero allocation on happy path - only allocates when error != nil.
internal/decoder/reflection.go:198
↓ 1 callersMethodwrapErrorAtOffset
wrapErrorAtOffset wraps an error with context at a specific offset. Used when the error occurs at a different offset than the decoder's current positi
internal/decoder/error_context.go:17
↓ 1 callersMethodwrapErrorWithSliceIndex
wrapErrorWithSliceIndex wraps an error with slice index context, building path retroactively. Zero allocation on happy path - only allocates when erro
internal/decoder/reflection.go:216
FunctionBenchmarkCityLookup
benchmarkCity mirrors geoip2-golang's City result shape, and the city lookup benchmarks below also populate Traits.IPAddress and Traits.Network to mat
reader_test.go:1251
FunctionBenchmarkCityLookupConcurrent
BenchmarkCityLookupConcurrent tests concurrent city lookups to demonstrate string cache performance under concurrent load.
reader_test.go:1339
FunctionBenchmarkCityLookupOnly
(b *testing.B)
reader_test.go:1273
FunctionBenchmarkCityLookupOnlyIPv6
(b *testing.B)
reader_test.go:1739
FunctionBenchmarkCityLookupWithPointers
(b *testing.B)
reader_test.go:1707
FunctionBenchmarkDecodeCountryCodeWithStruct
(b *testing.B)
reader_test.go:1291
FunctionBenchmarkDecodePathCountryCode
(b *testing.B)
reader_test.go:1316
FunctionBenchmarkFieldLookup
BenchmarkFieldLookup tests the performance of field lookup with the optimized field maps.
internal/decoder/performance_test.go:63
FunctionBenchmarkInterfaceLookup
(b *testing.B)
reader_test.go:1135
FunctionBenchmarkLookupNetwork
(b *testing.B)
reader_test.go:1154
FunctionBenchmarkNetworks
(b *testing.B)
traverse_test.go:390
FunctionBenchmarkOpen
(b *testing.B)
reader_test.go:1122
FunctionBenchmarkSimpleDecoding
BenchmarkSimpleDecoding tests basic decoding performance.
internal/decoder/performance_test.go:38
FunctionBenchmarkSkipEmptyValues
(b *testing.B)
traverse_test.go:550
FunctionBenchmarkStringCacheCold
(b *testing.B)
internal/decoder/string_cache_test.go:146
FunctionBenchmarkStringCacheHot
(b *testing.B)
internal/decoder/string_cache_test.go:137
FunctionBenchmarkStructDecoding
Map with: "en"->"Foo" BenchmarkStructDecoding tests the performance of struct decoding with the new optimized field access patterns.
internal/decoder/performance_test.go:13
FunctionBenchmarkWrapError_ErrorPath
Benchmark to show allocation only occurs on error path.
internal/decoder/error_context_test.go:82
FunctionBenchmarkWrapError_HappyPath
Benchmark to verify zero allocation on happy path.
internal/decoder/error_context_test.go:66
MethodBuildPath
BuildPath implements ErrorContextTracker interface.
internal/mmdberrors/context.go:74
MethodDecodePath
DecodePath decodes the data value at offset and stores the value associated with the path in the value pointed at by v.
internal/decoder/reflection.go:101
← previousnext →101–200 of 386, ranked by callers