Documentation ¶
Index ¶
- type AddrDialFunc
- type Link
- type Opts
- func (*Opts) Descriptor() ([]byte, []int)
- func (m *Opts) GetBufSize() uint32
- func (m *Opts) GetMtu() uint32
- func (m *Opts) GetQuic() *quic.Opts
- func (m *Opts) GetVerbose() bool
- func (*Opts) ProtoMessage()
- func (m *Opts) Reset()
- func (m *Opts) String() string
- func (m *Opts) XXX_DiscardUnknown()
- func (m *Opts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Opts) XXX_Merge(src proto.Message)
- func (m *Opts) XXX_Size() int
- func (m *Opts) XXX_Unmarshal(b []byte) error
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrDialFunc ¶
AddrDialFunc dials an address.
type Link ¶
type Link = transport_quic.Link
Link is a Quic-based connection/link backed by a reliable Conn.
type Opts ¶
type Opts struct { // Quic are the quic protocol options. Quic *quic.Opts `protobuf:"bytes,1,opt,name=quic,proto3" json:"quic,omitempty"` // Verbose turns on verbose debug logging. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` // Mtu sets the maximum size for a single packet. // Defaults to 65000. Mtu uint32 `protobuf:"varint,3,opt,name=mtu,proto3" json:"mtu,omitempty"` // BufSize is the number of packets to buffer. // // Total memory cap is mtu * bufSize. // Defaults to 10. BufSize uint32 `protobuf:"varint,4,opt,name=buf_size,json=bufSize,proto3" json:"buf_size,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Opts are extra options for the reliable conn.
func (*Opts) Descriptor ¶
func (*Opts) GetBufSize ¶
func (*Opts) GetVerbose ¶
func (*Opts) ProtoMessage ¶
func (*Opts) ProtoMessage()
func (*Opts) XXX_DiscardUnknown ¶
func (m *Opts) XXX_DiscardUnknown()
func (*Opts) XXX_Unmarshal ¶
type Transport ¶
type Transport struct { // Transport is the underlying quic transport *transport_quic.Transport // contains filtered or unexported fields }
Transport implements a Bifrost transport with reliable conns.
An example is a TCP connection: the OS provides an ordered stream of data as the interface for the Go program to use.
func NewTransport ¶
func NewTransport( ctx context.Context, le *logrus.Entry, privKey crypto.PrivKey, tc transport.TransportHandler, opts *Opts, uuid uint64, laddr net.Addr, addrDialer AddrDialFunc, ) (*Transport, error)
NewTransport constructs a new conn-backed transport.
addrDialer is an optional function to enable dialing out.
func (*Transport) HandleConn ¶
func (t *Transport) HandleConn( ctx context.Context, dial bool, c io.ReadWriteCloser, raddr net.Addr, peerID peer.ID, ) (*Link, error)
HandleConn handles an incoming or outgoing connection.
dial indicates if this is the originator (outgoing) conn or not ctx is used for the negotiation phase only if peerID is empty, allows any peer ID on the other end raddr can be nil if peerID is NOT empty