Movatterモバイル変換


[0]ホーム

URL:


drpcconn

package
v0.0.34Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License:MITImports:9Imported by:38

Details

Repository

github.com/storj/drpc

Links

README

package drpcconn

import "storj.io/drpc/drpcconn"

Package drpcconn creates a drpc client connection from a transport.

Usage

type Conn
type Conn struct {}

Conn is a drpc client connection.

func New
func New(tr drpc.Transport) *Conn

New returns a conn that uses the transport for reads and writes.

func NewWithOptions
func NewWithOptions(tr drpc.Transport, opts Options) *Conn

NewWithOptions returns a conn that uses the transport for reads and writes. TheOptions control details of how the conn operates.

func (*Conn) Close
func (c *Conn) Close() (err error)

Close closes the connection.

func (*Conn) Closed
func (c *Conn) Closed() <-chan struct{}

Closed returns a channel that is closed once the connection is closed.

func (*Conn) Invoke
func (c *Conn) Invoke(ctx context.Context, rpc string, enc drpc.Encoding, in, out drpc.Message) (err error)

Invoke issues the rpc on the transport serializing in, waits for a response, anddeserializes it into out. Only one Invoke or Stream may be open at a time.

func (*Conn) NewStream
func (c *Conn) NewStream(ctx context.Context, rpc string, enc drpc.Encoding) (_ drpc.Stream, err error)

NewStream begins a streaming rpc on the connection. Only one Invoke or Streammay be open at a time.

func (*Conn) Transport
func (c *Conn) Transport() drpc.Transport

Transport returns the transport the conn is using.

func (*Conn) Unblocked
func (c *Conn) Unblocked() <-chan struct{}

Unblocked returns a channel that is closed once the connection is no longerblocked by a previously canceled Invoke or NewStream call. It should not becalled concurrently with Invoke or NewStream.

type Options
type Options struct {// Manager controls the options we pass to the manager of this conn.Manager drpcmanager.Options}

Options controls configuration settings for a conn.

Documentation

Overview

Package drpcconn creates a drpc client connection from a transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeConn

type Conn struct {// contains filtered or unexported fields}

Conn is a drpc client connection.

funcNew

func New(trdrpc.Transport) *Conn

New returns a conn that uses the transport for reads and writes.

funcNewWithOptionsadded inv0.0.7

func NewWithOptions(trdrpc.Transport, optsOptions) *Conn

NewWithOptions returns a conn that uses the transport for reads and writes.The Options control details of how the conn operates.

func (*Conn)Close

func (c *Conn) Close() (errerror)

Close closes the connection.

func (*Conn)Closedadded inv0.0.7

func (c *Conn) Closed() <-chan struct{}

Closed returns a channel that is closed once the connection is closed.

func (*Conn)Invoke

func (c *Conn) Invoke(ctxcontext.Context, rpcstring, encdrpc.Encoding, in, outdrpc.Message) (errerror)

Invoke issues the rpc on the transport serializing in, waits for a response, anddeserializes it into out. Only one Invoke or Stream may be open at a time.

func (*Conn)NewStream

func (c *Conn) NewStream(ctxcontext.Context, rpcstring, encdrpc.Encoding) (_drpc.Stream, errerror)

NewStream begins a streaming rpc on the connection. Only one Invoke or Stream maybe open at a time.

func (*Conn)Transport

func (c *Conn) Transport()drpc.Transport

Transport returns the transport the conn is using.

func (*Conn)Unblockedadded inv0.0.33

func (c *Conn) Unblocked() <-chan struct{}

Unblocked returns a channel that is closed once the connection is no longerblocked by a previously canceled Invoke or NewStream call. It should notbe called concurrently with Invoke or NewStream.

typeOptionsadded inv0.0.7

type Options struct {// Manager controls the options we pass to the manager of this conn.Managerdrpcmanager.Options}

Options controls configuration settings for a conn.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp