Help us shape the future of Go! Take the 2026 Go Developer Survey

remoteinfo

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefreshableInstance added in v0.7.2

type RefreshableInstance interface {
	RefreshInstanceWithAddr(addr net.Addr) (newInstance discovery.Instance)
}

RefreshableInstance declares an interface which can return an instance containing the new address.

type RemoteInfo

type RemoteInfo interface {
	rpcinfo.EndpointInfo
	SetServiceName(name string)
	SetTag(key, value string) error
	ForceSetTag(key, value string)

	// SetTagLock freezes a tag key and makes future SetTag calls fail for that key.
	SetTagLock(key string)
	GetInstance() discovery.Instance
	SetInstance(ins discovery.Instance)

	// SetRemoteAddr tries to set the network address of the discovery.Instance held by RemoteInfo.
	// The result indicates whether the modification is successful.
	SetRemoteAddr(addr net.Addr) (ok bool)
	ImmutableView() rpcinfo.EndpointInfo
}

RemoteInfo implements rpcinfo.EndpointInfo for remote peer metadata backed by a discovery instance. It is primarily used as RPCInfo.To() on the client side.

func AsRemoteInfo

func AsRemoteInfo(r rpcinfo.EndpointInfo) RemoteInfo

AsRemoteInfo converts an rpcinfo.EndpointInfo into a RemoteInfo. Returns nil if impossible.

func NewRemoteInfo

func NewRemoteInfo(basicInfo *rpcinfo.EndpointBasicInfo, method string) RemoteInfo

NewRemoteInfo creates a remoteInfo from the given EndpointBasicInfo. The return value of the created RemoteInfo's Method method will be the `method` argument instead of the Method field in `basicInfo`. If the given basicInfo is nil, this function will panic.

Jump to

Keyboard shortcuts

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