package peer
import "google.golang.org/grpc/peer"
Package peer defines various peer information associated with RPCs and corresponding utils.
Index ¶
Functions ¶
func NewContext ¶
NewContext creates a new context with peer information attached.
Types ¶
type Peer ¶
type Peer struct {
// Addr is the peer address.
Addr net.Addr
// LocalAddr is the local address.
LocalAddr net.Addr
// AuthInfo is the authentication information of the transport.
// It is nil if there is no transport security being used.
AuthInfo credentials.AuthInfo
}
Peer contains the information of the peer for an RPC, such as the address and authentication information.
func FromContext ¶
FromContext returns the peer information in ctx if it exists.
func (*Peer) String ¶
String ensures the Peer types implements the Stringer interface in order to allow to print a context with a peerKey value effectively.
Source Files ¶
peer.go
- Version
- v1.79.0-dev
- Published
- Dec 11, 2025
- Platform
- darwin/amd64
- Imports
- 5 packages
- Last checked
- 28 minutes ago –
Tools for package owners.