convert

package
v0.0.0-...-d4285bb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(i interface{}) ([]byte, error)

Bytes converts an interface to a []byte.

func Float64

func Float64(i interface{}) (float64, error)

func GetBytes

func GetBytes(m map[string]interface{}, k string) ([]byte, error)

GetBytes converts a value in a map to a []byte.

func GetId

func GetId(m map[string]interface{}, k string) (bson.ObjectId, error)

GetId converts a value in a map to a bson.ObjectId.

func GetInt

func GetInt(m map[string]interface{}, k string) (int, error)

GetInt converts a value in a map to an int.

func GetInt64

func GetInt64(m map[string]interface{}, k string) (int64, error)

GetInt64 converts a value in a map to an int64.

func GetM

func GetM(m map[string]interface{}, k string) (bson.M, error)

GetM converts a value in a map to a bson.M.

func GetString

func GetString(m map[string]interface{}, k string) (string, error)

GetString converts a value in a map to a string.

func GetStrings

func GetStrings(m map[string]interface{}, k string) ([]string, error)

GetStrings converts a value in a map to a []string.

func Id

func Id(i interface{}) (bson.ObjectId, error)

Id tries to read a bson.ObjectId from a string.

func Int

func Int(i interface{}) (int, error)

func Int64

func Int64(i interface{}) (int64, error)

func Set

func Set(vals []string) map[string]bool

Set converts an array to a set.

func Strings

func Strings(i interface{}) ([]string, error)

Strings converts an interface to a []string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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