addressof

package
v1.7.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package addressof provides convenient functions for converting implementations of an interface to pointers to implementations of the interface. Tt turns a concrete struct which implements an interface iface cannot be converted to

*iface - go complains about it.
This does not work:
     impl := &interfaceImpl{}
     var ptr *iface = &cl
This also doesn't work:
     impl := &interfaceImpl{}
     var ptr *iface = &(cl.(iface)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NetworkServiceClient

NetworkServiceClient - convenience function to help in converting things from networkservice.NetworkServiceClient to *networkservice.NetworkServiceClient

it turns a concrete struct which implements networkservice.NetworkServiceClient cannot be converted to
*networkservice.NetworkServiceClient - go complains about it.
This does not work:
     impl := &clientImpl{}
     var onHeal *networkservice.NetworkServiceClient = &cl
This also doesn't work:
     impl := &clientImpl{}
     var ptr *networkservice.NetworkServiceClient = &(cl.(networkservice.NetworkServiceClient)
Using this function does:
     impl := &clientImpl{}
     var ptr *networkservice.NetworkServiceClient =NetworkServiceClient(cl)

func NetworkServiceEndpointRegistryClient

NetworkServiceEndpointRegistryClient converts client to *registry.NetworkServiceEndpointRegistryClient

func NetworkServiceRegistryClient

func NetworkServiceRegistryClient(client registry.NetworkServiceRegistryClient) *registry.NetworkServiceRegistryClient

NetworkServiceRegistryClient converts client to *registry.NetworkServiceRegistryClient

Types

This section is empty.

Jump to

Keyboard shortcuts

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