grpc: google.golang.org/grpc/peer Index | Files

package peer

import "google.golang.org/grpc/peer"

Package peer defines various peer information associated with RPCs and corresponding utils.

Index

Package Files

peer.go

func NewContext Uses

func NewContext(ctx context.Context, p *Peer) context.Context

NewContext creates a new context with peer information attached.

type Peer Uses

type Peer struct {
    // Addr is the peer address.
    Addr 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 Uses

func FromContext(ctx context.Context) (p *Peer, ok bool)

FromContext returns the peer information in ctx if it exists.

Package peer imports 3 packages (graph) and is imported by 236 packages. Updated 2018-11-13. Refresh now. Tools for package owners.