rpc

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IsDRPC is true if drpc is being used.
	IsDRPC = true

	// IsGRPC is true if grpc is being used.
	IsGRPC = false
)

Variables

View Source
var Error = errs.Class("rpccompat")

Error wraps all of the errors returned by this package.

Functions

func KnownNodeID added in v0.23.4

func KnownNodeID(address string) (id storj.NodeID, known bool)

KnownNodeID looks for a well-known node id for a given address

func NewDefaultManagerOptions added in v0.26.0

func NewDefaultManagerOptions() drpcmanager.Options

NewDefaultManagerOptions returns the default options we use for drpc managers.

Types

type CertificatesClient

type CertificatesClient = pb.DRPCCertificatesClient

CertificatesClient is an alias to the drpc client interface

func NewCertificatesClient

func NewCertificatesClient(rc *RawConn) CertificatesClient

NewCertificatesClient returns the drpc version of a CertificatesClient

type Conn

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

Conn is a wrapper around a drpc client connection.

func (*Conn) CertificatesClient

func (c *Conn) CertificatesClient() CertificatesClient

CertificatesClient returns a CertificatesClient for this connection

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection.

func (*Conn) ConnectionState

func (c *Conn) ConnectionState() tls.ConnectionState

ConnectionState returns the tls connection state.

func (*Conn) ContactClient

func (c *Conn) ContactClient() ContactClient

ContactClient returns a ContactClient for this connection

func (*Conn) HealthInspectorClient

func (c *Conn) HealthInspectorClient() HealthInspectorClient

HealthInspectorClient returns a HealthInspectorClient for this connection

func (*Conn) IrreparableInspectorClient

func (c *Conn) IrreparableInspectorClient() IrreparableInspectorClient

IrreparableInspectorClient returns a IrreparableInspectorClient for this connection

func (*Conn) MetainfoClient

func (c *Conn) MetainfoClient() MetainfoClient

MetainfoClient returns a MetainfoClient for this connection

func (*Conn) NodeClient

func (c *Conn) NodeClient() NodeClient

NodeClient returns a NodeClient for this connection

func (*Conn) NodeGracefulExitClient added in v0.24.0

func (c *Conn) NodeGracefulExitClient() NodeGracefulExitClient

NodeGracefulExitClient returns a NodeGracefulExitClient for this connection

func (*Conn) NodeStatsClient

func (c *Conn) NodeStatsClient() NodeStatsClient

NodeStatsClient returns a NodeStatsClient for this connection

func (*Conn) OrdersClient

func (c *Conn) OrdersClient() OrdersClient

OrdersClient returns a OrdersClient for this connection

func (*Conn) OverlayInspectorClient

func (c *Conn) OverlayInspectorClient() OverlayInspectorClient

OverlayInspectorClient returns a OverlayInspectorClient for this connection

func (*Conn) PaymentsClient added in v0.25.0

func (c *Conn) PaymentsClient() PaymentsClient

PaymentsClient returns a PaymentsClient for this connection

func (*Conn) PeerIdentity

func (c *Conn) PeerIdentity() (*identity.PeerIdentity, error)

PeerIdentity returns the peer identity on the other end of the connection.

func (*Conn) PieceStoreInspectorClient

func (c *Conn) PieceStoreInspectorClient() PieceStoreInspectorClient

PieceStoreInspectorClient returns a PieceStoreInspectorClient for this connection

func (*Conn) PiecestoreClient

func (c *Conn) PiecestoreClient() PiecestoreClient

PiecestoreClient returns a PiecestoreClient for this connection

func (*Conn) ReferralManagerClient added in v0.26.0

func (c *Conn) ReferralManagerClient() ReferralManagerClient

ReferralManagerClient returns a ReferralManagerClient for this connection

func (*Conn) SatelliteGracefulExitClient added in v0.24.0

func (c *Conn) SatelliteGracefulExitClient() SatelliteGracefulExitClient

SatelliteGracefulExitClient returns a SatelliteGracefulExitClient for this connection

func (*Conn) VouchersClient

func (c *Conn) VouchersClient() VouchersClient

VouchersClient returns a VouchersClient for this connection

type ContactClient

type ContactClient = pb.DRPCContactClient

ContactClient is an alias to the drpc client interface

func NewContactClient

func NewContactClient(rc *RawConn) ContactClient

NewContactClient returns the drpc version of a ContactClient

type Dialer

type Dialer struct {
	// TLSOptions controls the tls options for dialing. If it is nil, only
	// insecure connections can be made.
	TLSOptions *tlsopts.Options

	// DialTimeout causes all the tcp dials to error if they take longer
	// than it if it is non-zero.
	DialTimeout time.Duration

	// DialLatency sleeps this amount if it is non-zero before every dial.
	// The timeout runs while the sleep is happening.
	DialLatency time.Duration

	// TransferRate limits all read/write operations to go slower than
	// the size per second if it is non-zero.
	TransferRate memory.Size

	// PoolCapacity is the maximum number of cached connections to hold.
	PoolCapacity int

	// ConnectionOptions controls the options that we pass to drpc connections.
	ConnectionOptions drpcconn.Options
}

Dialer holds configuration for dialing.

func NewDefaultDialer

func NewDefaultDialer(tlsOptions *tlsopts.Options) Dialer

NewDefaultDialer returns a Dialer with default timeouts set.

func (Dialer) DialAddressID

func (d Dialer) DialAddressID(ctx context.Context, address string, id storj.NodeID) (_ *Conn, err error)

DialAddressID dials to the specified address and asserts it has the given node id.

func (Dialer) DialAddressInsecure

func (d Dialer) DialAddressInsecure(ctx context.Context, address string) (_ *Conn, err error)

DialAddressInsecure dials to the specified address and does not check the node id.

func (Dialer) DialAddressInsecureBestEffort added in v0.23.4

func (d Dialer) DialAddressInsecureBestEffort(ctx context.Context, nodeURL string) (_ *Conn, err error)

DialAddressInsecureBestEffort is like DialAddressInsecure but tries to dial a node securely if it can.

nodeURL is like a storj.NodeURL but (a) requires an address and (b) does not require a full node id and will work with just a node prefix. The format is either:

  • node_host:node_port
  • node_id_prefix@node_host:node_port

Examples:

  • 33.20.0.1:7777
  • [2001:db8:1f70::999:de8:7648:6e8]:7777
  • 12vha9oTFnerx@33.20.0.1:7777
  • 12vha9oTFnerx@[2001:db8:1f70::999:de8:7648:6e8]:7777

DialAddressInsecureBestEffort:

  • will use a node id if provided in the nodeURL paramenter
  • will otherwise look up the node address in a known map of node address to node ids and use the remembered node id.
  • will otherwise dial insecurely

func (Dialer) DialAddressUnencrypted

func (d Dialer) DialAddressUnencrypted(ctx context.Context, address string) (_ *Conn, err error)

DialAddressUnencrypted dials to the specified address without tls.

func (Dialer) DialNode

func (d Dialer) DialNode(ctx context.Context, node *pb.Node) (_ *Conn, err error)

DialNode creates an rpc connection to the specified node.

type HealthInspectorClient

type HealthInspectorClient = pb.DRPCHealthInspectorClient

HealthInspectorClient is an alias to the drpc client interface

func NewHealthInspectorClient

func NewHealthInspectorClient(rc *RawConn) HealthInspectorClient

NewHealthInspectorClient returns the drpc version of a HealthInspectorClient

type IrreparableInspectorClient

type IrreparableInspectorClient = pb.DRPCIrreparableInspectorClient

IrreparableInspectorClient is an alias to the drpc client interface

func NewIrreparableInspectorClient

func NewIrreparableInspectorClient(rc *RawConn) IrreparableInspectorClient

NewIrreparableInspectorClient returns the drpc version of a IrreparableInspectorClient

type MetainfoClient

type MetainfoClient = pb.DRPCMetainfoClient

MetainfoClient is an alias to the drpc client interface

func NewMetainfoClient

func NewMetainfoClient(rc *RawConn) MetainfoClient

NewMetainfoClient returns the drpc version of a MetainfoClient

type NodeClient

type NodeClient = pb.DRPCNodeClient

NodeClient is an alias to the drpc client interface

func NewNodeClient

func NewNodeClient(rc *RawConn) NodeClient

NewNodeClient returns the drpc version of a NodeClient

type NodeGracefulExitClient added in v0.24.0

type NodeGracefulExitClient = pb.DRPCNodeGracefulExitClient

NodeGracefulExitClient is an alias to the drpc client interface

func NewNodeGracefulExitClient added in v0.24.0

func NewNodeGracefulExitClient(rc *RawConn) NodeGracefulExitClient

NewNodeGracefulExitClient returns the drpc version of a NodeGracefulExitClient

type NodeStatsClient

type NodeStatsClient = pb.DRPCNodeStatsClient

NodeStatsClient is an alias to the drpc client interface

func NewNodeStatsClient

func NewNodeStatsClient(rc *RawConn) NodeStatsClient

NewNodeStatsClient returns the drpc version of a NodeStatsClient

type OrdersClient

type OrdersClient = pb.DRPCOrdersClient

OrdersClient is an alias to the drpc client interface

func NewOrdersClient

func NewOrdersClient(rc *RawConn) OrdersClient

NewOrdersClient returns the drpc version of a OrdersClient

type OverlayInspectorClient

type OverlayInspectorClient = pb.DRPCOverlayInspectorClient

OverlayInspectorClient is an alias to the drpc client interface

func NewOverlayInspectorClient

func NewOverlayInspectorClient(rc *RawConn) OverlayInspectorClient

NewOverlayInspectorClient returns the drpc version of a OverlayInspectorClient

type PaymentsClient added in v0.25.0

type PaymentsClient = pb.DRPCPaymentsClient

PaymentsClient is an alias to the drpc client interface

func NewPaymentsClient added in v0.25.0

func NewPaymentsClient(rc *RawConn) PaymentsClient

NewPaymentsClient returns the drpc version of a PaymentsClient

type PieceStoreInspectorClient

type PieceStoreInspectorClient = pb.DRPCPieceStoreInspectorClient

PieceStoreInspectorClient is an alias to the drpc client interface

func NewPieceStoreInspectorClient

func NewPieceStoreInspectorClient(rc *RawConn) PieceStoreInspectorClient

NewPieceStoreInspectorClient returns the drpc version of a PieceStoreInspectorClient

type PiecestoreClient

type PiecestoreClient = pb.DRPCPiecestoreClient

PiecestoreClient is an alias to the drpc client interface

func NewPiecestoreClient

func NewPiecestoreClient(rc *RawConn) PiecestoreClient

NewPiecestoreClient returns the drpc version of a PiecestoreClient

type RawConn

type RawConn = rpcpool.Conn

RawConn is a type alias to a drpc client connection

type ReferralManagerClient added in v0.26.0

type ReferralManagerClient = pb.DRPCReferralManagerClient

ReferralManagerClient is an alias to the drpc client interface

func NewReferralManagerClient added in v0.26.0

func NewReferralManagerClient(rc *RawConn) ReferralManagerClient

NewReferralManagerClient returns the drpc version of a ReferralManagerClient

type SatelliteGracefulExitClient added in v0.24.0

type SatelliteGracefulExitClient = pb.DRPCSatelliteGracefulExitClient

SatelliteGracefulExitClient is an alias to the drpc client interface

func NewSatelliteGracefulExitClient added in v0.24.0

func NewSatelliteGracefulExitClient(rc *RawConn) SatelliteGracefulExitClient

NewSatelliteGracefulExitClient returns the drpc version of a SatelliteGracefulExitClient

type VouchersClient

type VouchersClient = pb.DRPCVouchersClient

VouchersClient is an alias to the drpc client interface

func NewVouchersClient

func NewVouchersClient(rc *RawConn) VouchersClient

NewVouchersClient returns the drpc version of a VouchersClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL