File: deserializer.go

package info (click to toggle)
golang-github-oschwald-maxminddb-golang 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 248 kB
  • sloc: makefile: 3
file content (31 lines) | stat: -rw-r--r-- 951 bytes parent folder | download | duplicates (2)
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
30
31
package maxminddb

import "math/big"

// deserializer is an interface for a type that deserializes an MaxMind DB
// data record to some other type. This exists as an alternative to the
// standard reflection API.
//
// This is fundamentally different than the Unmarshaler interface that
// several packages provide. A Deserializer will generally create the
// final struct or value rather than unmarshaling to itself.
//
// This interface and the associated unmarshaling code is EXPERIMENTAL!
// It is not currently covered by any Semantic Versioning guarantees.
// Use at your own risk.
type deserializer interface {
	ShouldSkip(offset uintptr) (bool, error)
	StartSlice(size uint) error
	StartMap(size uint) error
	End() error
	String(string) error
	Float64(float64) error
	Bytes([]byte) error
	Uint16(uint16) error
	Uint32(uint32) error
	Int32(int32) error
	Uint64(uint64) error
	Uint128(*big.Int) error
	Bool(bool) error
	Float32(float32) error
}