cast

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cast provides the typeCasting of an object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value interface {
	ToInt64() (int64, error)
	ToInt32() (int32, error)
	ToInt16() (int16, error)
	ToInt8() (int8, error)
	ToInt() (int, error)
	ToUint() (uint, error)
	ToUint64() (uint64, error)
	ToUint32() (uint32, error)
	ToUint16() (uint16, error)
	ToUint8() (uint8, error)
	ToString() (string, error)
	ToStringMapStringSlice() (map[string][]string, error)
	ToStringMapBool() (map[string]bool, error)
	ToStringMap() (map[string]interface{}, error)
	ToSlice() ([]interface{}, error)
	ToBoolSlice() ([]bool, error)
	ToStringSlice() ([]string, error)
	ToIntSlice() ([]int, error)
	ToBool() (bool, error)
	ToFloat64() (float64, error)
}

Value is an interface to typecast an Object

func NewValue

func NewValue(val interface{}, err error) Value

NewValue creates an object for an interface X

Jump to

Keyboard shortcuts

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