drpcconn
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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) *ConnNew returns a conn that uses the transport for reads and writes.
func NewWithOptions
func NewWithOptions(tr drpc.Transport, opts Options) *ConnNewWithOptions 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.TransportTransport 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¶
- type Conn
- func (c *Conn) Close() (err error)
- func (c *Conn) Closed() <-chan struct{}
- func (c *Conn) Invoke(ctx context.Context, rpc string, enc drpc.Encoding, in, out drpc.Message) (err error)
- func (c *Conn) NewStream(ctx context.Context, rpc string, enc drpc.Encoding) (_ drpc.Stream, err error)
- func (c *Conn) Transport() drpc.Transport
- func (c *Conn) Unblocked() <-chan struct{}
- type Options
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.
funcNewWithOptions¶added inv0.0.7
NewWithOptions returns a conn that uses the transport for reads and writes.The Options control details of how the conn operates.
func (*Conn)Closed¶added 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¶
NewStream begins a streaming rpc on the connection. Only one Invoke or Stream maybe open at a time.
typeOptions¶added 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.