Documentation ¶
Index ¶
- Constants
- Variables
- func KnownNodeID(address string) (id storj.NodeID, known bool)
- func NewDefaultManagerOptions() drpcmanager.Options
- type CertificatesClient
- type Conn
- func (c *Conn) CertificatesClient() CertificatesClient
- func (c *Conn) Close() error
- func (c *Conn) ConnectionState() tls.ConnectionState
- func (c *Conn) ContactClient() ContactClient
- func (c *Conn) HealthInspectorClient() HealthInspectorClient
- func (c *Conn) IrreparableInspectorClient() IrreparableInspectorClient
- func (c *Conn) MetainfoClient() MetainfoClient
- func (c *Conn) NodeClient() NodeClient
- func (c *Conn) NodeGracefulExitClient() NodeGracefulExitClient
- func (c *Conn) NodeStatsClient() NodeStatsClient
- func (c *Conn) OrdersClient() OrdersClient
- func (c *Conn) OverlayInspectorClient() OverlayInspectorClient
- func (c *Conn) PaymentsClient() PaymentsClient
- func (c *Conn) PeerIdentity() (*identity.PeerIdentity, error)
- func (c *Conn) PieceStoreInspectorClient() PieceStoreInspectorClient
- func (c *Conn) PiecestoreClient() PiecestoreClient
- func (c *Conn) ReferralManagerClient() ReferralManagerClient
- func (c *Conn) SatelliteGracefulExitClient() SatelliteGracefulExitClient
- func (c *Conn) VouchersClient() VouchersClient
- type ContactClient
- type Dialer
- func (d Dialer) DialAddressID(ctx context.Context, address string, id storj.NodeID) (_ *Conn, err error)
- func (d Dialer) DialAddressInsecure(ctx context.Context, address string) (_ *Conn, err error)
- func (d Dialer) DialAddressInsecureBestEffort(ctx context.Context, nodeURL string) (_ *Conn, err error)
- func (d Dialer) DialAddressUnencrypted(ctx context.Context, address string) (_ *Conn, err error)
- func (d Dialer) DialNode(ctx context.Context, node *pb.Node) (_ *Conn, err error)
- type HealthInspectorClient
- type IrreparableInspectorClient
- type MetainfoClient
- type NodeClient
- type NodeGracefulExitClient
- type NodeStatsClient
- type OrdersClient
- type OverlayInspectorClient
- type PaymentsClient
- type PieceStoreInspectorClient
- type PiecestoreClient
- type RawConn
- type ReferralManagerClient
- type SatelliteGracefulExitClient
- type VouchersClient
Constants ¶
const ( // IsDRPC is true if drpc is being used. IsDRPC = true // IsGRPC is true if grpc is being used. IsGRPC = false )
Variables ¶
var Error = errs.Class("rpccompat")
Error wraps all of the errors returned by this package.
Functions ¶
func KnownNodeID ¶ added in v0.23.4
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) 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 ¶
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 ¶
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 ¶
DialAddressUnencrypted dials to the specified address without tls.
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 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