types

package module
v0.0.0-...-0d8999b Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: BSD-3-Clause Imports: 6 Imported by: 4

README

types

Build Status GoDoc

Package types have functions to create an instantiation of one type from the type name.

Documentation

Overview

Package types have functions to create an instantiation of one type from the type name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocStructPtrs

func AllocStructPtrs(val reflect.Value)

AllocStructPtrs find pointers in a struct and alloc than recursivily.

func AnySettableValue

func AnySettableValue(val reflect.Value) bool

AnySettableValue find if exist one value that you can set.

func Copy

func Copy(src reflect.Value) reflect.Value

Copy create a new value with all data of src copied into it.

func Dump

func Dump()

Dump the name and the type from the type base.

func GetType

func GetType(tname string) (reflect.Type, error)

GetType return the type represented by tname

func Insert

func Insert(i interface{})

Insert type for future instantiation. Do this in the same package where the type was declared. The use of init function is advised.

func InsertName

func InsertName(tname string, i interface{})

InsertName inserts a new type with the name.

func InsertType

func InsertType(t reflect.Type)

InsertType insertes a type for future instantiation. Do this in the same package where the type was declared. The use of init function is advised.

func IsEqualName

func IsEqualName(val reflect.Value, tname string) bool

IsEqualName compares the value type name with one name.

func Make

func Make(t reflect.Type) (val reflect.Value)

Make instantiate a value of t type and allocate pointer and slices.

func MakeNew

func MakeNew(tname string, bufcap int) (val reflect.Value)

MakeNew create a new value from the type's name

func MakeNewType

func MakeNewType(t reflect.Type, bufcap int) (val reflect.Value)

MakeNewType creates a new value with type t.

func MakeZero

func MakeZero(tname string) reflect.Value

MakeZero creates a zero value type for the type name.

func Name

func Name(i interface{}) string

Name accepts a variable of any type and returns the package name and the name of the type or a function

func NameOf

func NameOf(t reflect.Type) string

NameOf returns the package name and the name of the type

func Type

func Type(tname string) reflect.Type

Type returns the Type from the type name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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