registry

package
v0.0.0-...-ebc58a5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 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 gad.Object.

func ToInterface

func ToInterface(in any) (out any, ok bool)

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

func ToObject

func ToObject(in any) (out any, ok bool)

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

Types

type Converter

type Converter func(in any) (out any, 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