func (b Bits) Gigabytes() float64 {
	bytes := b / Gigabyte
	bits := b % Gigabyte
	return float64(bytes) + float64(bits)/(8*1000*1000*1000)
}
Gigabytes returns the size as a floating point number of gigabytes.
package types
import (
	"database/sql/driver"
	"encoding/json"
	"errors"
	"strconv"
)
const Version = "0.22"
type NullString struct {
	Valid  bool
	String string
}
func (ns *NullString) UnmarshalJSON(b []byte) error {
	if string(b) == "null" {
		ns.Valid = false
		return nil
	}
	var s string
	err := json.Unmarshal(b, &s)
	if err != nil {
		return err
	}
	ns.Valid = true
	ns.String = s
	return nil
}
func (ns NullString) MarshalJSON() ([]byte, error) {
	if !ns.Valid {
		return []byte("null"), nil
	}
	s, err := json.Marshal(ns.String)
	if err != nil {
		return []byte{}, err
	}
	return s, nil
}
func (ns *NullString) Scan(value interface{}) error {
	if value == nil {
		ns.String, ns.Valid = "", false
		return nil
	}
	ns.String, ns.Valid = value.(string)
	return nil
}
func (ns NullString) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return ns.String, nil
}
var errLeadingInt = errors.New("time: bad [0-9]*")  
func leadingInt(s string) (x int64, rem string, err error) {
	i := 0
	for ; i < len(s); i++ {
		c := s[i]
		if c < '0' || c > '9' {
			break
		}
		if x > (1<<63-1)/10 {
			return 0, "", errLeadingInt
		}
		x = x*10 + int64(c) - '0'
		if x < 0 {
			return 0, "", errLeadingInt
		}
	}
	return x, s[i:], nil
}
func leadingFraction(s string) (x int64, scale float64, rem string) {
	i := 0
	scale = 1
	overflow := false
	for ; i < len(s); i++ {
		c := s[i]
		if c < '0' || c > '9' {
			break
		}
		if overflow {
			continue
		}
		if x > (1<<63-1)/10 {
			overflow = true
			continue
		}
		y := x*10 + int64(c) - '0'
		if y < 0 {
			overflow = true
			continue
		}
		x = y
		scale *= 10
	}
	return x, scale, s[i:]
}
func fmtInt(buf []byte, v uint64) int {
	w := len(buf)
	if v == 0 {
		w--
		buf[w] = '0'
	} else {
		for v > 0 {
			w--
			buf[w] = byte(v%10) + '0'
			v /= 10
		}
	}
	return w
}
func fmtFrac(buf []byte, v uint64, prec int) (nw int, nv uint64) {
	w := len(buf)
	print := false
	for i := 0; i < prec; i++ {
		digit := v % 10
		print = print || digit != 0
		if print {
			w--
			buf[w] = byte(digit) + '0'
		}
		v /= 10
	}
	if print {
		w--
		buf[w] = '.'
	}
	return w, v
}
var unitMap = map[string]int64{
	"bit": int64(Bit),
	"B":   int64(Byte),
	"kB":  int64(Kilobyte),
	"MB":  int64(Megabyte),
	"GB":  int64(Gigabyte),
	"TB":  int64(Terabyte),
	"PB":  int64(Petabyte),
	"EB":  int64(Exabyte),
}
const (
	Bit  Bits = 1
	Byte      = 8 * Bit
	Kilobyte = 1000 * Byte
	Megabyte = 1000 * Kilobyte
	Gigabyte = 1000 * Megabyte
	Terabyte = 1000 * Gigabyte
	Petabyte = 1000 * Terabyte
	Exabyte  = 1000 * Petabyte
)
type Bits int64
func (b Bits) Bytes() float64 {
	bytes := b / Byte
	bits := b % Byte
	return float64(bytes) + float64(bits)/8
}
func (b Bits) Kilobytes() float64 {
	bytes := b / Kilobyte
	bits := b % Kilobyte
	return float64(bytes) + float64(bits)/(8*1000)
}
func (b Bits) Megabytes() float64 {
	bytes := b / Megabyte
	bits := b % Megabyte
	return float64(bytes) + float64(bits)/(8*1000*1000)
}