types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Sourced with modifications from https://github.com/cosmos/cosmos-sdk/blob/d1b5b0c5ae2c51206cc1849e09e4d59986742cc3/codec/types/interface_registry.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnpackInterfaces

func UnpackInterfaces(x interface{}, unpacker cosmosCodecTypes.AnyUnpacker) error

UnpackInterfaces is a convenience function that calls UnpackInterfaces on x if x implements UnpackInterfacesMessage

Types

type ProbeInterfaceRegistry

type ProbeInterfaceRegistry struct {
	// contains filtered or unexported fields
}

func NewInterfaceRegistry

NewInterfaceRegistry returns a new InterfaceRegistry

func (*ProbeInterfaceRegistry) EnsureRegistered

func (registry *ProbeInterfaceRegistry) EnsureRegistered(impl interface{}) error

EnsureRegistered ensures there is a registered interface for the given concrete type.

Returns an error if not, and nil if so.

func (*ProbeInterfaceRegistry) ListAllInterfaces

func (registry *ProbeInterfaceRegistry) ListAllInterfaces() []string

func (*ProbeInterfaceRegistry) ListImplementations

func (registry *ProbeInterfaceRegistry) ListImplementations(ifaceName string) []string

func (*ProbeInterfaceRegistry) RegisterCustomTypeURL

func (registry *ProbeInterfaceRegistry) RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message)

RegisterCustomTypeURL registers a concrete type which implements the given interface under `typeURL`.

This function PANICs if different concrete types are registered under the same typeURL.

func (*ProbeInterfaceRegistry) RegisterImplementations

func (registry *ProbeInterfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message)

RegisterImplementations registers a concrete proto Message which implements the given interface.

This function PANICs if different concrete types are registered under the same typeURL.

func (*ProbeInterfaceRegistry) RegisterInterface

func (registry *ProbeInterfaceRegistry) RegisterInterface(protoName string, iface interface{}, impls ...proto.Message)

func (*ProbeInterfaceRegistry) Resolve

func (registry *ProbeInterfaceRegistry) Resolve(typeURL string) (proto.Message, error)

Resolve returns the proto message given its typeURL. It works with types registered with RegisterInterface/RegisterImplementations, as well as those registered with RegisterWithCustomTypeURL.

func (*ProbeInterfaceRegistry) TypeURLIsRegistered

func (registry *ProbeInterfaceRegistry) TypeURLIsRegistered(typeURL string) bool

func (*ProbeInterfaceRegistry) UnpackAny

func (registry *ProbeInterfaceRegistry) UnpackAny(any *cosmosCodecTypes.Any, iface interface{}) error

Jump to

Keyboard shortcuts

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