mmdbtype

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 30

Documentation

Overview

Package mmdbtype provides types used within the MaxMind DB format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

Bool is the MaxMind DB boolean type.

func (Bool) Copy

func (t Bool) Copy() DataType

Copy the value.

func (Bool) Equal

func (t Bool) Equal(other DataType) bool

Equal checks for equality.

func (Bool) WriteTo

func (t Bool) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Bytes

type Bytes []byte

Bytes is the MaxMind DB bytes type.

func (Bytes) Copy

func (t Bytes) Copy() DataType

Copy the value.

func (Bytes) Equal

func (t Bytes) Equal(other DataType) bool

Equal checks for equality.

func (Bytes) WriteTo

func (t Bytes) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type DataType

type DataType interface {
	Copy() DataType
	Equal(DataType) bool

	WriteTo(writer) (int64, error)
	// contains filtered or unexported methods
}

DataType represents a MaxMind DB data type.

type Float32

type Float32 float32

Float32 is the MaxMind DB float type.

func (Float32) Copy

func (t Float32) Copy() DataType

Copy the value.

func (Float32) Equal

func (t Float32) Equal(other DataType) bool

Equal checks for equality.

func (Float32) WriteTo

func (t Float32) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Float64

type Float64 float64

Float64 is the MaxMind DB double type.

func (Float64) Copy

func (t Float64) Copy() DataType

Copy the value.

func (Float64) Equal

func (t Float64) Equal(other DataType) bool

Equal checks for equality.

func (Float64) WriteTo

func (t Float64) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Int32

type Int32 int32

Int32 is the MaxMind DB signed 32-bit integer type.

func (Int32) Copy

func (t Int32) Copy() DataType

Copy the value.

func (Int32) Equal

func (t Int32) Equal(other DataType) bool

Equal checks for equality.

func (Int32) WriteTo

func (t Int32) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Map

type Map map[String]DataType

Map is the MaxMind DB map type.

func (Map) Copy

func (t Map) Copy() DataType

Copy makes a deep copy of the Map.

func (Map) Equal

func (t Map) Equal(other DataType) bool

Equal checks for equality.

func (Map) WriteTo

func (t Map) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Pointer

type Pointer uint32

Pointer is the MaxMind DB pointer type for internal use in the writer. You should not use this type in data structures that you pass to methods on mmdbwriter.Tree. Doing so may result in a corrupt database.

func (Pointer) Copy

func (t Pointer) Copy() DataType

Copy the value.

func (Pointer) Equal

func (t Pointer) Equal(other DataType) bool

Equal checks for equality.

func (Pointer) WriteTo

func (t Pointer) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

func (Pointer) WrittenSize

func (t Pointer) WrittenSize() int64

WrittenSize is the actual total size of the pointer in the database data section.

type Slice

type Slice []DataType

Slice is the MaxMind DB array type.

func (Slice) Copy

func (t Slice) Copy() DataType

Copy makes a deep copy of the Slice.

func (Slice) Equal

func (t Slice) Equal(other DataType) bool

Equal checks for equality.

func (Slice) WriteTo

func (t Slice) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type String

type String string

String is the MaxMind DB string type.

func (String) Copy

func (t String) Copy() DataType

Copy the value.

func (String) Equal

func (t String) Equal(other DataType) bool

Equal checks for equality.

func (String) WriteTo

func (t String) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Uint128

type Uint128 big.Int

Uint128 is the MaxMind DB unsigned 128-bit integer type.

func (*Uint128) Copy

func (t *Uint128) Copy() DataType

Copy make a deep copy of the Uint128.

func (*Uint128) Equal

func (t *Uint128) Equal(other DataType) bool

Equal checks for equality.

func (*Uint128) WriteTo

func (t *Uint128) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Uint16

type Uint16 uint16

Uint16 is the MaxMind DB unsigned 16-bit integer type.

func (Uint16) Copy

func (t Uint16) Copy() DataType

Copy the value.

func (Uint16) Equal

func (t Uint16) Equal(other DataType) bool

Equal checks for equality.

func (Uint16) WriteTo

func (t Uint16) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Uint32

type Uint32 uint32

Uint32 is the MaxMind DB unsigned 32-bit integer type.

func (Uint32) Copy

func (t Uint32) Copy() DataType

Copy the value.

func (Uint32) Equal

func (t Uint32) Equal(other DataType) bool

Equal checks for equality.

func (Uint32) WriteTo

func (t Uint32) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

type Uint64

type Uint64 uint64

Uint64 is the MaxMind DB unsigned 64-bit integer type.

func (Uint64) Copy

func (t Uint64) Copy() DataType

Copy the value.

func (Uint64) Equal

func (t Uint64) Equal(other DataType) bool

Equal checks for equality.

func (Uint64) WriteTo

func (t Uint64) WriteTo(w writer) (int64, error)

WriteTo writes the value to w.

Jump to

Keyboard shortcuts

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