factory

package
v0.0.0-...-a8cc34e Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: LGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExistType     = errors.New("exist type")
	ErrExistTypeName = errors.New("exist type name")
	ErrUnknownType   = errors.New("unknown type")
)

transaction errors

Functions

This section is empty.

Types

type Factory

type Factory struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Factory provides type's factory

func NewFactory

func NewFactory() *Factory

NewFactory returns a Factory

func (*Factory) Create

func (fc *Factory) Create(t uint16) (interface{}, error)

Create creates the instance of the type

func (*Factory) Register

func (fc *Factory) Register(t uint16, v interface{}) error

Register add the type

func (*Factory) TypeName

func (fc *Factory) TypeName(t uint16) (string, error)

TypeName returns the name of the type

func (*Factory) TypeOf

func (fc *Factory) TypeOf(v interface{}) (uint16, error)

TypeOf returns the type of the value

Jump to

Keyboard shortcuts

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