Documentation ¶
Index ¶
- Constants
- Variables
- func CtxIdentity(ctx context.Context) ([]byte, error)
- func CtxPeerAddr(ctx context.Context) string
- func CtxPeerClientVersion(ctx context.Context) string
- func CtxPeerId(ctx context.Context) (string, error)
- func CtxProtoVersion(ctx context.Context) (uint32, error)
- func CtxPubKey(ctx context.Context) (crypto.PubKey, error)
- func CtxWithClientVersion(ctx context.Context, addr string) context.Context
- 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
- func CtxWithProtoVersion(ctx context.Context, version uint32) context.Context
- type Peer
Constants ¶
View Source
const CtxResponsiblePeers = "*"
Variables ¶
Functions ¶
func CtxIdentity ¶
CtxIdentity returns identity from context
func CtxPeerClientVersion ¶ added in v0.2.2
CtxPeerClientVersion returns peer client version
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 CtxProtoVersion ¶ added in v0.4.23
CtxProtoVersion returns peer protocol version
func CtxWithClientVersion ¶ added in v0.2.2
CtxWithClientVersion sets peer clientVersion to the context
func CtxWithIdentity ¶
CtxWithIdentity sets identity in the context
func CtxWithPeerAddr ¶
CtxWithPeerAddr sets peer address to the context
func CtxWithPeerId ¶
CtxWithPeerId sets peer id in the context
Types ¶
type Peer ¶
type Peer interface { Id() string Context() context.Context AcquireDrpcConn(ctx context.Context) (drpc.Conn, error) ReleaseDrpcConn(conn drpc.Conn) DoDrpc(ctx context.Context, do func(conn drpc.Conn) error) error IsClosed() bool CloseChan() <-chan struct{} // SetTTL overrides the default pool ttl SetTTL(ttl time.Duration) TryClose(objectTTL time.Duration) (res bool, err error) ocache.Object }
Click to show internal directories.
Click to hide internal directories.