stream_drpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstablishDrpcConn

func EstablishDrpcConn(
	ctx context.Context,
	b bus.Bus,
	opts *DrpcOpts,
	protocolID protocol.ID,
	srcPeer, destPeer peer.ID,
	transportID uint64,
) (*drpcconn.Conn, func(), error)

EstablishDrpcConn establishes a drpc connection with a peer.

srcPeer, transportID can be empty.

func NewDrpcConn

func NewDrpcConn(ctx context.Context, strm stream.Stream, opts *DrpcOpts) (*drpcconn.Conn, error)

NewDrpcConn constructs a new dprc conn from a stream.

Types

type DrpcOpts

type DrpcOpts struct {
	// ManagerOpts are drpc manager options.
	ManagerOpts          *ManagerOpts `protobuf:"bytes,1,opt,name=manager_opts,json=managerOpts,proto3" json:"manager_opts,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

DprcOpts are drpc connection options.

func (*DrpcOpts) BuildOpts

func (o *DrpcOpts) BuildOpts() (drpcconn.Options, error)

BuildOpts converts to drpc conn opts.

func (*DrpcOpts) Descriptor

func (*DrpcOpts) Descriptor() ([]byte, []int)

func (*DrpcOpts) GetManagerOpts

func (m *DrpcOpts) GetManagerOpts() *ManagerOpts

func (*DrpcOpts) ProtoMessage

func (*DrpcOpts) ProtoMessage()

func (*DrpcOpts) Reset

func (m *DrpcOpts) Reset()

func (*DrpcOpts) String

func (m *DrpcOpts) String() string

func (*DrpcOpts) Validate

func (o *DrpcOpts) Validate() error

Validate checks the ops.

func (*DrpcOpts) XXX_DiscardUnknown

func (m *DrpcOpts) XXX_DiscardUnknown()

func (*DrpcOpts) XXX_Marshal

func (m *DrpcOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DrpcOpts) XXX_Merge

func (m *DrpcOpts) XXX_Merge(src proto.Message)

func (*DrpcOpts) XXX_Size

func (m *DrpcOpts) XXX_Size() int

func (*DrpcOpts) XXX_Unmarshal

func (m *DrpcOpts) XXX_Unmarshal(b []byte) error

type ManagerOpts

type ManagerOpts struct {
	// WriterBufferSize controls the size of the buffer that we will fill before
	// flushing. Normal writes to streams typically issue a flush explicitly.
	WriterBufferSize uint32 `protobuf:"varint,1,opt,name=writer_buffer_size,json=writerBufferSize,proto3" json:"writer_buffer_size,omitempty"`
	// StreamOpts are options for streams created by the manager.
	StreamOpts *StreamOpts `protobuf:"bytes,2,opt,name=stream_opts,json=streamOpts,proto3" json:"stream_opts,omitempty"`
	// InactivityTimeout is the amount of time the manager will wait when creating
	// a NewServerStream. It only includes the time it is reading packets from the
	// remote client. In other words, it only includes the time that the client
	// could delay before invoking an RPC. If zero or negative, no timeout.
	InactivityTimeout    string   `protobuf:"bytes,3,opt,name=inactivity_timeout,json=inactivityTimeout,proto3" json:"inactivity_timeout,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ManagerOpts are drpc manager options.

func (*ManagerOpts) BuildOpts

func (o *ManagerOpts) BuildOpts() (drpcmanager.Options, error)

BuildOpts converts to manager opts.

func (*ManagerOpts) Descriptor

func (*ManagerOpts) Descriptor() ([]byte, []int)

func (*ManagerOpts) GetInactivityTimeout

func (m *ManagerOpts) GetInactivityTimeout() string

func (*ManagerOpts) GetStreamOpts

func (m *ManagerOpts) GetStreamOpts() *StreamOpts

func (*ManagerOpts) GetWriterBufferSize

func (m *ManagerOpts) GetWriterBufferSize() uint32

func (*ManagerOpts) ParseInactivityTimeout

func (o *ManagerOpts) ParseInactivityTimeout() (time.Duration, error)

ParseInactivityTimeout parses the inactivity timeout field.

func (*ManagerOpts) ProtoMessage

func (*ManagerOpts) ProtoMessage()

func (*ManagerOpts) Reset

func (m *ManagerOpts) Reset()

func (*ManagerOpts) String

func (m *ManagerOpts) String() string

func (*ManagerOpts) Validate

func (o *ManagerOpts) Validate() error

Validate checks the ops.

func (*ManagerOpts) XXX_DiscardUnknown

func (m *ManagerOpts) XXX_DiscardUnknown()

func (*ManagerOpts) XXX_Marshal

func (m *ManagerOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ManagerOpts) XXX_Merge

func (m *ManagerOpts) XXX_Merge(src proto.Message)

func (*ManagerOpts) XXX_Size

func (m *ManagerOpts) XXX_Size() int

func (*ManagerOpts) XXX_Unmarshal

func (m *ManagerOpts) XXX_Unmarshal(b []byte) error

type StreamOpts

type StreamOpts struct {
	// SplitSize controls the default size we split packets into frames.
	SplitSize            uint32   `protobuf:"varint,1,opt,name=split_size,json=splitSize,proto3" json:"split_size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StreamOpts are options for a drpc stream.

func (*StreamOpts) BuildOpts

func (o *StreamOpts) BuildOpts() drpcstream.Options

BuildOpts converts to stream opts.

func (*StreamOpts) Descriptor

func (*StreamOpts) Descriptor() ([]byte, []int)

func (*StreamOpts) GetSplitSize

func (m *StreamOpts) GetSplitSize() uint32

func (*StreamOpts) ProtoMessage

func (*StreamOpts) ProtoMessage()

func (*StreamOpts) Reset

func (m *StreamOpts) Reset()

func (*StreamOpts) String

func (m *StreamOpts) String() string

func (*StreamOpts) Validate

func (o *StreamOpts) Validate() error

Validate checks the ops.

func (*StreamOpts) XXX_DiscardUnknown

func (m *StreamOpts) XXX_DiscardUnknown()

func (*StreamOpts) XXX_Marshal

func (m *StreamOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamOpts) XXX_Merge

func (m *StreamOpts) XXX_Merge(src proto.Message)

func (*StreamOpts) XXX_Size

func (m *StreamOpts) XXX_Size() int

func (*StreamOpts) XXX_Unmarshal

func (m *StreamOpts) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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