Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteAddrSetter ¶
RemoteAddrSetter is used to set remote addr.
type RemoteInfo ¶
type RemoteInfo interface {
rpcinfo.EndpointInfo
SetServiceName(name string)
SetTag(key, value string) error
ForceSetTag(key, value string)
// SetTagLock freezes a key of the tags and refuses further modification on its value.
SetTagLock(key string)
GetInstance() discovery.Instance
SetInstance(ins discovery.Instance)
// SetRemoteAddr tries to set the network address of the discovery.Instance hold by RemoteInfo.
// The result indicates whether the modification is successful.
SetRemoteAddr(addr net.Addr) (ok bool)
CopyFrom(from RemoteInfo)
ImmutableView() rpcinfo.EndpointInfo
}
RemoteInfo implements a rpcinfo.EndpointInfo with mutable address and connection. It is typically used to represent server info on client side or client info on server 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 wrapping the given endpointInfo. 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.
Click to show internal directories.
Click to hide internal directories.