typeregistry

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 1 Imported by: 0

README

a library to create type dynamically

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddType

func AddType(i interface{}) string

AddType add type to registry center

func AddTypeWithKey

func AddTypeWithKey(i interface{}, keyFunc func(i interface{}) string) string

AddTypeWithKey add type to registry center with key generator func

func AddTypes

func AddTypes(interfaces []interface{})

AddTypes add multiple types to registry center

func AddTypesWithKey

func AddTypesWithKey(interfaces []interface{}, keyFunc func(i interface{}) string)

AddTypesWithKey add type to registry center with key generator func

func CleanRegistry

func CleanRegistry()

CleanRegistry clean registed types

func Create

func Create(key string) interface{}

Create create type by key If type is pointer, Make will create an object, point to it and return none null pointer

func CreateSlice

func CreateSlice(key string) interface{}

CreateSlice create slice type by key

func GetLen

func GetLen(i interface{}) int

GetLen return lengh of slice stored in interface

func RegistryLen

func RegistryLen() int

RegistryLen return count of registied type

Types

This section is empty.

Jump to

Keyboard shortcuts

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