Documentation ¶
Index ¶
- Variables
- func CtxIdentity(ctx context.Context) ([]byte, error)
- func CtxPeerAddr(ctx context.Context) string
- func CtxPeerId(ctx context.Context) (string, error)
- func CtxPubKey(ctx context.Context) (crypto.PubKey, error)
- func CtxWithIdentity(ctx context.Context, identity []byte) context.Context
- func CtxWithPeerAddr(ctx context.Context, addr string) context.Context
- func CtxWithPeerId(ctx context.Context, peerId string) context.Context
- type Peer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPeerIdNotFoundInContext = errors.New("peer id not found in context") ErrIdentityNotFoundInContext = errors.New("identity not found in context") )
Functions ¶
func CtxIdentity ¶
CtxIdentity returns identity from context
func CtxPeerId ¶
CtxPeerId first tries to get peer id under our own key, but if it is not found tries to get through DRPC key
func CtxWithIdentity ¶
CtxWithIdentity sets identity in the context
func CtxWithPeerAddr ¶
CtxWithPeerAddr sets peer address to the context
Types ¶
Click to show internal directories.
Click to hide internal directories.