helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatUint

func FormatUint(u uint64) []byte

FormatUint serializes a uint64. It's borrowed from the standard library's strconv package, but with the signed cases removed and only formats in base 10. If the return value is being converted to a string using strconv directly might be faster.

func Length

func Length(x uint64) int

Length finds the number of digits in a uint64. For example, 12 returns 2, 100 returns 3, and 1776 returns 4. The minimum width is 1.

func ParseIP

func ParseIP(remoteaddr string) (string, error)

ParseIP returns a valid IP address for the given *http.Request.RemoteAddr if available.

func ParseUint

func ParseUint(s []byte) (n uint64, err error)

ParseUint is like ParseInt but for unsigned numbers. It's stolen from the strconv package and streamlined for uint64s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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