types

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameOf added in v2.1.0

func NameOf(v any) string

NameOf returns the name of a given object

func Of added in v2.1.0

func Of(v any) reflect.Type

Of returns the runtime type of object

Types

type Registry

type Registry interface {
	// Register an object
	Register(v any)
	// Deregister removes the registered object from the registry
	Deregister(v any)
	// Exists return true when a given object is in the registry
	Exists(v any) bool
	// TypesMap returns the list of registered at any point in time
	TypesMap() map[string]reflect.Type
	// Type returns the type of object
	Type(v any) (reflect.Type, bool)
	// TypeOf returns the type of object name
	TypeOf(name string) (reflect.Type, bool)
}

Registry defines the types registry interface

func NewRegistry

func NewRegistry() Registry

NewRegistry creates a new types registry

type Unit

type Unit struct{}

Unit type

Jump to

Keyboard shortcuts

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