byteconv

package
v0.0.0-...-b553abb Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package byteconv converts sql.RawBytes for MySQL or MariaDB to primitive types.

It supports the null types.

Index

Constants

This section is empty.

Variables

View Source
var UseStdLib = false

UseStdLib set to true to use the standard library strconv functions. They are much slower and only ParseFloat has more precision.

Functions

func LenInt

func LenInt(i int64) int

func ParseBool

func ParseBool(b []byte) (v bool, ok bool, err error)

ParseBool same as strconv.ParseBool but faster and no allocations. Use err == nil to check if a bool value is valid.

func ParseFloat

func ParseFloat(b []byte) (v float64, ok bool, err error)

Float parses a byte-slice and returns the float it represents. If an invalid character is encountered, it will stop there.

func ParseInt

func ParseInt(b []byte) (v int64, ok bool, err error)

ParseInt parses a byte-slice and returns the integer it represents. If an invalid character is encountered, it returns a syntax error.

func ParseUint

func ParseUint(s []byte, base int, bitSize int) (n uint64, ok bool, err error)

ParseUint is like strconv.ParseUint, but using a []byte.

Types

This section is empty.

Jump to

Keyboard shortcuts

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