Documentation ¶
Overview ¶
Sourced with modifications from https://github.com/cosmos/cosmos-sdk/blob/d1b5b0c5ae2c51206cc1849e09e4d59986742cc3/codec/types/interface_registry.go
Index ¶
- func UnpackInterfaces(x interface{}, unpacker cosmosCodecTypes.AnyUnpacker) error
- type ProbeInterfaceRegistry
- func (registry *ProbeInterfaceRegistry) EnsureRegistered(impl interface{}) error
- func (registry *ProbeInterfaceRegistry) ListAllInterfaces() []string
- func (registry *ProbeInterfaceRegistry) ListImplementations(ifaceName string) []string
- func (registry *ProbeInterfaceRegistry) RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message)
- func (registry *ProbeInterfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message)
- func (registry *ProbeInterfaceRegistry) RegisterInterface(protoName string, iface interface{}, impls ...proto.Message)
- func (registry *ProbeInterfaceRegistry) Resolve(typeURL string) (proto.Message, error)
- func (registry *ProbeInterfaceRegistry) TypeURLIsRegistered(typeURL string) bool
- func (registry *ProbeInterfaceRegistry) UnpackAny(any *cosmosCodecTypes.Any, iface interface{}) error
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 ¶
func NewInterfaceRegistry() (cosmosCodecTypes.InterfaceRegistry, *ProbeInterfaceRegistry)
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