serialize

package
v2.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package serialize decodes the gzipped binary blobs the library embeds for its metadata and prefix lookups (carrier, geocoding, timezone, and region maps).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeUnzip

func DecodeUnzip(data []byte) ([]byte, error)

DecodeUnzip gunzips data and returns the decompressed bytes.

Types

type IntStringArrayMap

type IntStringArrayMap struct {
	Map       map[int][]string
	MaxLength int
}

IntStringArrayMap is our map from an int to an array of strings; this is used for our timezone and region maps.

func LoadIntArrayMap

func LoadIntArrayMap(data []byte) (*IntStringArrayMap, error)

LoadIntArrayMap decodes a key->[]string map from a gzipped binary blob.

type IntStringMap

type IntStringMap struct {
	Map       map[int]string
	MaxLength int
}

IntStringMap is our data structure for maps from prefixes to a single string; this is used for our carrier and geocoding maps.

func LoadPrefixMap

func LoadPrefixMap(data []byte) (*IntStringMap, error)

LoadPrefixMap decodes a prefix->string map from a gzipped binary blob.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL