dbtype

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigInt

type BigInt struct {
	V       big.Int
	IsValid bool
}

BigInt is a type that represents big.Int that may be null, this type is used for JSON/Database marshalling.

For JSON values we encoded BigInt's as strings.

For Database values we encoded BigInt's as NUMERIC(78).

func NewBigInt

func NewBigInt(n int64) BigInt

func NewBigIntFromString

func NewBigIntFromString(s string, base int) BigInt

func ToBigInt

func ToBigInt(b *big.Int) BigInt

func ToBigIntArray

func ToBigIntArray(bs []*big.Int) []BigInt

func ToBigIntArrayFromStringArray

func ToBigIntArrayFromStringArray(s []string, base int) ([]BigInt, error)

func ToBigIntFromInt64

func ToBigIntFromInt64(n int64) BigInt

func (*BigInt) Add

func (b *BigInt) Add(n *big.Int)

func (BigInt) Equals

func (b BigInt) Equals(n *big.Int) bool

func (BigInt) Gt

func (b BigInt) Gt(n *big.Int) bool

func (BigInt) Gte

func (b BigInt) Gte(n *big.Int) bool

func (BigInt) Int

func (b BigInt) Int() *big.Int

func (BigInt) Int64

func (b BigInt) Int64() int64

func (BigInt) Lt

func (b BigInt) Lt(n *big.Int) bool

func (BigInt) Lte

func (b BigInt) Lte(n *big.Int) bool

func (BigInt) MarshalJSON

func (b BigInt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (BigInt) MarshalText

func (b BigInt) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*BigInt) Scan

func (b *BigInt) Scan(src interface{}) error

func (*BigInt) SetString

func (b *BigInt) SetString(s string, base int) bool

func (BigInt) String

func (b BigInt) String() string

func (*BigInt) Sub

func (b *BigInt) Sub(n *big.Int)

func (BigInt) Uint64

func (b BigInt) Uint64() uint64

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(text []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*BigInt) UnmarshalText

func (b *BigInt) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (BigInt) Value

func (b BigInt) Value() (driver.Value, error)

type HexBytes

type HexBytes []byte

func (HexBytes) BytesValue

func (b HexBytes) BytesValue() ([]byte, error)

BytesValue implements pgx/pgtype.BytesValuer

func (HexBytes) MarshalText

func (b HexBytes) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (*HexBytes) ScanBytes

func (b *HexBytes) ScanBytes(v []byte) error

ScanBytes implements pgx/pgtype.BytesScanner

func (HexBytes) String

func (b HexBytes) String() string

String returns encoded b as a hex string with 0x prefix.

func (*HexBytes) UnmarshalJSON

func (b *HexBytes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*HexBytes) UnmarshalText

func (b *HexBytes) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Jump to

Keyboard shortcuts

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