registry

package
v0.0.0-...-8cdf743 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAnyConverter

func RegisterAnyConverter(typ reflect.Type, converter Converter)

RegisterAnyConverter registers a converter for a specific type to be used with ToAny that converts to any.

func RegisterObjectConverter

func RegisterObjectConverter(typ reflect.Type, converter Converter)

RegisterObjectConverter registers a converter for a specific type to be used with ToObject that converts to a charlang.Object.

func ToInterface

func ToInterface(in interface{}) (out interface{}, ok bool)

ToInterface tries to convert any value to any using the registered converters. This should be called in charlang.ToInterface.

func ToObject

func ToObject(in interface{}) (out interface{}, ok bool)

ToObject tries to convert any value to a charlang.Object using the registered converters. This should be called in charlang.ToObject.

Types

type Converter

type Converter func(in interface{}) (out interface{}, ok bool)

Converter is a function that converts a value of one type to another.

Jump to

Keyboard shortcuts

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